Skip to content

Escape wiki markup in plain Confluence text with <nowiki> - #477

Merged
danielriedmueller merged 1 commit into
mainfrom
fix-formats
Oct 12, 2026
Merged

danielriedmueller merged 1 commit into
mainfrom
fix-formats

Conversation

@Boldewyn

@Boldewyn Boldewyn commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Pandoc passes text like "[[wiki]]", "{{tpl}}" or "''x''" through
unchanged, so it became live markup in MediaWiki (links, template
calls, italics).

Add the EscapeWikiMarkup DOM preprocessor, running first, so it only
sees original Confluence text and never wikitext emitted by later
processors. The is hidden behind a placeholder to bypass
pandoc. Text in pre, code, plain-text-body and parameter elements is
left alone.

Page categories were injected as wikitext into the HTML source, i.e.
before the DOM preprocessors, and would have been escaped. Append them
to the final wikitext in postprocessWikiText() instead. The output is
unchanged.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Pandoc passes text like "[[wiki]]", "{{tpl}}" or "''x''" through
unchanged, so it became live markup in MediaWiki (links, template
calls, italics).

Add the EscapeWikiMarkup DOM preprocessor, running first, so it only
sees original Confluence text and never wikitext emitted by later
processors. The <nowiki> is hidden behind a placeholder to bypass
pandoc. Text in pre, code, plain-text-body and parameter elements is
left alone.

Page categories were injected as wikitext into the HTML source, i.e.
before the DOM preprocessors, and would have been escaped. Append them
to the final wikitext in postprocessWikiText() instead. The output is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielriedmueller
danielriedmueller merged commit e05b1eb into main Oct 12, 2026
1 check passed
@danielriedmueller
danielriedmueller deleted the fix-formats branch October 12, 2026 06:59
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.

2 participants