Skip to content

Add gh_ids: derive heading ids by GitHub's rules - #54

Merged
jph00 merged 1 commit into
mainfrom
pr/add-gh-ids-derive-heading-ids-by-github-s-rules
Aug 27, 2026
Merged

Add gh_ids: derive heading ids by GitHub's rules#54
jph00 merged 1 commit into
mainfrom
pr/add-gh-ids-derive-heading-ids-by-github-s-rules

Conversation

@jph00

@jph00 jph00 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Rewritten from @PiotrCzapla's #43, keeping his corpus-validated slug rule (2285/2290 anchors across 196 GitHub wiki pages) and his tests. Closes #43.

gh_ids=True on mdhtml2html and md2html derives automatic heading ids by GitHub's rules instead of the dialect's, so anchors match a GitHub-rendered page and links written against one keep working. Off by default.

Two changes from #43: a bool instead of a slug= mode string, and a heading whose slug comes out empty mints no id (id="" is invalid HTML and unaddressable, on GitHub too) while still holding its dedupe slot, so repeats take -1, -2 in step with GitHub. Details are in DIALECT.md's automatic heading ids paragraphs.

@jph00 jph00 added the enhancement New feature or request label Aug 27, 2026
@jph00
jph00 merged commit 61a6fe3 into main Aug 27, 2026
@jph00
jph00 deleted the pr/add-gh-ids-derive-heading-ids-by-github-s-rules branch August 27, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant