Ghost blog - How to link within the same document using an anchor tag in markdown

It took me way too long to figure out how to link to a headline further down in my blog post within markdown. I hope I can save you some time with this post. Down below I have a headline "Link to headline" and here is the link to it: Link to headline.

The code powering it is the following for the link:

[Link to headline](#linktoheadline)

and the following for the headline:

###Link to headline

The link part should start with # and then the name of the headline without any spaces. That is all there is to it, you can define the text you wish for the link.

Link to headline

I hope this helps you linking within the same document on your ghost blog. If you made it work or had problems with this solution, let me know down below in the comments!

Not working?

It was reported in the comments that on some blogs it may be needed to use a hyphen like:

[Link to headline](#link-to-headline)

That is not the syntax that works for me, but if it works for you, please leave a comment down below (I would like to know!). To be sure of your format, check the HTML output and match that in your link. In the HTML of my blog you will see that the id of the h3 tag is without a hyphen:

<h3 id="linktoheadline">Link to headline</h3>

The # part of your link should match the id you want to link to.