Heading anchors not being created

Hello,

I’m a paid Write.as subscriber and I’ve tried to use the instructions in this post to link to section headings indicated with #, ##, etc. from else where in my posts:

For example, if I have a heading like this:

## This is a heading

And I would create links to it elsewhere in my post with:

[link to the heading](#This-is-a-heading)

Indeed “link to the heading” is created as a link in my published post to the post URL followed by #This-is-a-heading, but when I click on it, it doesn’t take me to the heading!

Instead, I have to manually create an anchor by prepending this to my actual heading (which is described here and here):

## <a id="This-is-a-heading"></a> This is a heading

Now, my “link to the heading” link in the post would take me to that heading.

This works but is cumbersome and brittle.

Are headings not automatically parsed and created a linkable anchors by Write.as? Or am I doing something wrong?

Thanks in advance for your detailed response! :folded_hands:

Hi, we do automatically generate heading IDs so they can be linked like this! You can confirm by viewing the source of your post, where you should see id="this-is-a-heading" on each heading tag.

However, these IDs are generated in all lowercase, so that might be the issue here. If you use the lowercase, does it work for you? E.g.

[link to the heading](#this-is-a-heading)
1 Like

Aha, that’s it! I had headings with capital letters, and didn’t know they’d be converted to all lowercase in the IDs.

Thank you so much @matt! :heart: :folded_hands:

Is this documented somewhere?