Skip to content

Add html id to headers so that you can link to specific headers in the markdown.#55

Open
markcho wants to merge 1 commit intojfernandez:mainfrom
markcho:HeaderAnchors
Open

Add html id to headers so that you can link to specific headers in the markdown.#55
markcho wants to merge 1 commit intojfernandez:mainfrom
markcho:HeaderAnchors

Conversation

@markcho
Copy link
Copy Markdown

@markcho markcho commented Dec 18, 2025

Currently, generated html doesn't include any anchors or ids on the header.

This PR uses the Github-style slugs for header ids so that links to headers now work. This is useful for things like table of contents at the top.

Copy link
Copy Markdown
Owner

@jfernandez jfernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feature. Main ask: drop the regex dependency. Since markdown-rs produces clean HTML (no attributes on headings), this can be done with str::find for the heading tags and a simple char iterator to strip inner HTML. That avoids pulling in aho-corasick, regex-automata, and regex-syntax for two simple patterns.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants