Skip to content

#29414 feat(confluence): Show the table of contents macro - #17

Merged
marcreichel merged 1 commit into
mainfrom
feat/#29414-toc-macro
Nov 30, 2026
Merged

marcreichel merged 1 commit into
mainfrom
feat/#29414-toc-macro

Conversation

@marcreichel

Copy link
Copy Markdown
Member

Summary

  • Confluence's table of contents macro (toc) was dropped by OtherMacroRemover, so long pages showed up in AGP without their table of contents.
  • New TocMacroReplacer replaces each toc macro with a nested <nav class="toc"><ul>…</ul></nav> that links to the page's headings. Headings without an id get one, so the links have a target.
  • Honors the macro's minLevel and maxLevel parameters. The other parameters (style, outline, include/exclude, flat type) are ignored.
  • Heading ids are ASCII slugs (toc-einfuehrung, duplicates get -2, -3). repairPageContent() percent-encodes non-ASCII characters in href, but not in id, so umlaut ids would break the links.
  • The link text keeps the heading's encoded markup (Einf&uuml;hrung), because repairPageContent() mangles raw non-ASCII characters.
  • Register it after IncludeMacroReplacer, so included headings are listed, and before OtherMacroRemover.

Part of artemeon/core-ng#29414

@marcreichel
marcreichel merged commit 8aa06f0 into main Nov 30, 2026
8 checks passed
@marcreichel
marcreichel deleted the feat/#29414-toc-macro branch November 30, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant