Skip to content

Conversation

@scripthunter7
Copy link
Member

Fix #672

This PR fixes the issue where two headings could end up with the same ID in Docusaurus. By default, if two titles have the same text (e.g. ## Example and ### Example), Docusaurus’s slugger utility is smart enough to handle this in a stateful way by adding -1, -2 etc suffixes. However, if we manually override the ID (e.g. # Example {#custom-id}), collisions can occur. To prevent this, I wrote a very simple markdownlint rule and fixed the problematic cases. Additionally, this PR updates the markdownlint configuration to use the official markdownlint CLI tool, which properly supports custom rules.

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Preview was deployed to: https://pull-request-679.kb-adg.pages.dev/

@github-actions
Copy link

Preview was deployed to: https://pull-request-679.kb-adg.pages.dev/

@github-actions
Copy link

Preview was deployed to: https://pull-request-679.kb-adg.pages.dev/

@scripthunter7 scripthunter7 merged commit 5437321 into master Apr 21, 2025
2 checks passed
@scripthunter7 scripthunter7 deleted the fix/672 branch April 21, 2025 17:33
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.

Handle or prevent duplicated titles

6 participants