Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Links to other elements in imported markdown are not imported correctly

Edited

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)
## 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?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence Mythbusters: Does Atlassian even use Confluence?

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...

1,707 views 7 32
Read article

Community Events

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

Events near you