fix: escape underscores in docstring markdown titles#422
Open
kapsner wants to merge 2 commits intomachow:mainfrom
Open
fix: escape underscores in docstring markdown titles#422kapsner wants to merge 2 commits intomachow:mainfrom
kapsner wants to merge 2 commits intomachow:mainfrom
Conversation
Author
|
Hi @machow , just wanted to know, if the purpose of this PR is clear enough, or if you want me to add more information / details / tests or something else? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: When documenting private or protected class members that contain leading underscore(s)
_in their name (e.g.,__init__,__call__,_some_other_private_member, etc.), rendering a pdf-book (and docx) results in broken headings (i.e., the{#module.import.path.class.__member__}-part is visible in the final document).Solution: This PR introduces the escaping of underscores in the display-name of docstring headers:
https://github.com/kapsner/quartodoc/blob/a2c1cade88504efe5bb4798980e110d43cc7b06b/quartodoc/renderers/md_renderer.py#L393
Verification: On my local system, I could verify that this PR fixes the faulty behaviour for pdf- and docx-format (For html, I only checked after implementing this and everything looks fine as well, however, I have not checked, if the faulty behaviour previously also occurred for html-documents).
Best, Lorenz