You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
Long story short, when using markdown2 as part of pdoc to generate documentation of a Python project, and one has two identically-named headers in different docstrings (but the same module/file), they will generate an identical anchor.
Expected behavior
Different headers with same names should have different anchors so they can be properly referenced.
Additional context
I haven't found anything in the Markdown spec that mentions what should be done in case of identical headers (or how the anchors should be generated in the first place), so technically this is not a bug, but an issue with the spec being undefined (or implementation-defined?). Nevertheless, it would be nice if there was an option in this library to disambiguate headers with the same name via some option.
The text was updated successfully, but these errors were encountered:
I think the problem is that the way pdoc converts docstrings is by passing each one as a markdown snippet, rather than a single document. Every time pdoc calls Markdown.convert, the counter that keeps track of header IDs is reset as part of the _setup_extras function
The solution here would be to either persist the header count across resets or provide some way of preventing the reset between conversions.
Describe the bug
This is a report from downstream, see mitmproxy/pdoc#534 and mitmproxy/pdoc#497 for more details (was told to report it here).
To Reproduce
Long story short, when using
markdown2
as part ofpdoc
to generate documentation of a Python project, and one has two identically-named headers in different docstrings (but the same module/file), they will generate an identical anchor.Expected behavior
Different headers with same names should have different anchors so they can be properly referenced.
Additional context
I haven't found anything in the Markdown spec that mentions what should be done in case of identical headers (or how the anchors should be generated in the first place), so technically this is not a bug, but an issue with the spec being undefined (or implementation-defined?). Nevertheless, it would be nice if there was an option in this library to disambiguate headers with the same name via some option.
The text was updated successfully, but these errors were encountered: