I'm trying to include some automatically-generated markdown on a wiki page. I'm using the "Insert Markup" macro to insert the markdown into a wiki page. My issue is that I cannot find a solution to create inter-page links (hyperlinks to other anchors on the same page).
Things I've tried:
Option 1: Using an "id" or "name" attribute on an HTML element in the markdown to create an anchor point. The problem is that "id" and "name" html attributes are stripped off when saving (but not on import!). For instance,
<span id="test"> TEST ME </span>
is correctly imported (yes, I know it's HTML nested within markdown), but when I save the page, the id is stripped away and all I'm left with is:
<span> TEST ME </span>
To get this option to work, I'd have to figure out a way to maintain the id attribute when saving. I imagine Conluence strips all that stuff off for security reasons or something.
Option 2: Try to use a pure markdown approach.
[link to my heading](#myHeading)
This works in most markdown viewers (I've tested in github and a Visual Studio Code markdown viewer extension), but when I import into Confluence it turns into the following:
<a href="#myHeading">link to my heading</a>
<h2 id="Page-Name-myHeading"> myHeading </h2>
So the problem here is that Confluence appends "Page-Name" (the specific name of whatever page this is on) to the anchor when creating the <h2> tag, but it creates the INCORRECT href attribute on the <a> tag. This seems to be a bug in Confluence, but perhaps I'm using it wrong?
Hi, Confluence collaborators! As part of #Confluence-Collaboratory month, we’ve created a very special Mythsbusters segment, where we're dive into an interesting myth and uncover the truth behind i...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events