Skip to content

Instantly share code, notes, and snippets.

@iTrooz
Created June 1, 2022 07:18
Show Gist options
  • Save iTrooz/a137ea0d9db332001a75db365c2b2089 to your computer and use it in GitHub Desktop.
Save iTrooz/a137ea0d9db332001a75db365c2b2089 to your computer and use it in GitHub Desktop.
Github markdown custom heading ID on anchor

I recently spent an hour on Googl trying to figure out how to have a custom ID on an anchor, because titles like this

Hello I am a very long title. Why ? Because I wanted to

are quite annoying to reference then

What is what I learned : apparently, there's no way to do it in Github's markdown. There seems to have been a way to do it in the past using ### Some title {#custom-id}

BUT there is a way to do that using HTML. I didn't even know we could have some HTML tags in Markdown, but.. here we are : (check the raw version to see how it works) Thx https://stackoverflow.com/questions/27981247/github-markdown-same-page-link

This is the first place

Hello, this is some text to fill in this, here, is a link to the second place.

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

some very long text

HelloWorld

Place one has the fun times of linking here, but I can also link back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment