cosmere
cosmere copied to clipboard
Anchors don't work in Confluence
Example in Markdown:
# Cosmere Test Child-Page
[Anchor Test](#target)
## h2
### h3
#### Target
## h2 2
### h3 2
#### Target
Is rendered as:
<p><a href="#target">Anchor Test</a></p>
<h2 id="h2">h2</h2>
<h3 id="h3">h3</h3>
<h4 id="target">Target</h4>
<h2 id="h2-2">h2 2</h2>
<h3 id="h3-2">h3 2</h3>
<h4 id="target">Target</h4>
But Confluence generates the following headers:
<h2 id="CosmereTestChildPage-h2">h2</h2>
<h3 id="CosmereTestChildPage-h3">h3</h3>
<h4 id="CosmereTestChildPage-Target">Target</h4>
<h2 id="CosmereTestChildPage-h22">h2 2</h2>
<h3 id="CosmereTestChildPage-h32">h3 2</h3>
<h4 id="CosmereTestChildPage-Target.1">Target</h4>
The ids of the headings would need to be adjusted to be: (confluence slug of title)-(confluence slug of heading)(.1 etc. for duplicates)
Problem 1: figuring out how the Confluence slugging mechanism works Problem 2: figuring out if there are duplicate headers in the article (hint: make renderer stateful)