Nullndr
Nullndr

Reputation: 1827

Is there a way to link to a section with special characters in markdown?

Given the following header ## Header in a markdown file, it is possible to create a link to this header with [Link to header](#header-in-a-markdown-file).

This works well, but is there a way to create a link to the ## Header (in markdown) header or ## && operator header?

I do not want to misc markdown and HTML, I want markdown only.

Upvotes: 2

Views: 1326

Answers (1)

Quentin
Quentin

Reputation: 943564

Nothing about the standard rules of Markdown will give a heading an ID you can link to automatically.

Either your (unspecified) Markdown to HTML converter has an extension which does that or you are doing some kind of post-processing to add the IDs to the HTML.

Either way, it probably is generating an ID and you just need to find out what it is.

  • Convert your Markdown to HTML
  • View the HTML source
  • Look at the id attribute on the heading

Then you can type that into the URL for your link.

Odds are that it will just URL encode the ( and ) characters.

Upvotes: 3

Related Questions