docs: fix markdown parsing issue with underscores in link attributes and italic text #76
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.
The
python-markdown
parser (viamd_in_html
extension) incorrectly handles underscores when a{:target="_blank"}
attribute is combined with markdown italic text on the same line.Current Behavior
In
docs/why_this_guide.md
, lines containing both link attributes and italic text are parsed incorrectly:Generates incorrect HTML:
Root Cause
The
md_in_html
extension (enabled inmkdocs.yml
) appears to misinterpret the underscore in_blank
as a markdown italic marker when it appears before other italic text.Solution
Escape the underscore in
_blank
when on the same line as italic text.Testing
Parsing comparison available at: https://babelmark.github.io/?text=In+%5BVU%23425163%5D(https%3A%2F%2Fkb.cert.org%2Fvuls%2Fid%2F425163)%7B%3Atarget%3D%22%5C_blank%22%7D+_Machine+learning_%2C%0A%0AIn+%5BVU%23425163%5D(https%3A%2F%2Fkb.cert.org%2Fvuls%2Fid%2F425163)%7B%3Atarget%3D%22_blank%22%7D+_Machine+learning_%2C
note: scroll down to section 2 to view results from
python-markdown
Related Configuration
This issue involves the
md_in_html
extension listed undermarkdown_extensions
inmkdocs.yml
, which is likely related to themkdocs-material*
requirements.Contributions to this project are subject to the terms listed in CONTRIBUTING.md.