allejo / jekyll-anchor-headings

A GitHub Pages compatible way of adding anchors to your headings without a plug-in or JavaScript :octocat:
https://pure-liquid.allejo.org/
MIT License
186 stars 31 forks source link

Don't generate anchor if there's no ID #1

Closed allejo closed 6 years ago

allejo commented 6 years ago

If headings don't have an ID (creating manually with raw HTML), an anchor shouldn't be generated for them.

garazdawi commented 3 years ago

Hello!

In a project I recently switched from kramdown to commonmark to generate the HTML for markdown files, and one of the issues that I came across was that commonmark does not generate ids for its headers.

I've updated my local version of anchor_headings to create ids and add anchors for headers.

Would you like a PR for this where you can turn this functionality on with an option?

allejo commented 3 years ago

I've updated my local version of anchor_headings to create ids and add anchors for headers.

Would you like a PR for this where you can turn this functionality on with an option?

Sure @garazdawi! I'd welcome that 😄 Especially since commonmark doesn't have this functionality built in and I know it's been complained about.