Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mechanism to prevent header ID counter resetting (issue #530) #540

Merged

Conversation

Crozzers
Copy link
Contributor

@Crozzers Crozzers commented Dec 3, 2023

This PR closes #530 by adding a mechanism to prevent the header-ids counter from being reset between conversions. To quote from the issue:

when using markdown2 as part of pdoc [...] two identically-named headers in different docstrings (but the same module/file), [...] will generate an identical anchor

Every time pdoc calls Markdown.convert, the counter that keeps track of header IDs is reset as part of the _setup_extras function

Two proposed solutions were to either stop resetting the ID counter between conversions OR to add an option to disable this behaviour. The latter has been implemented as I think it's less likely to break backwards compatibility.

@nicholasserra
Copy link
Collaborator

Thank you!

@nicholasserra nicholasserra merged commit b123d68 into trentm:master Dec 3, 2023
18 checks passed
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.

Same header names generate identical HTML anchors
2 participants