Fix Fenced Code Syntax Highlighting in Markdown Leaking #14626
Merged
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.
Bug
This builds on #14488 to fix a number of issues where syntax highlighting leaks outside of code blocks in markdown files. A simple repo currently is this markdown:
Which is incorrectly colored as:
Fix
Leverage the updated while rule logic from #14488 to break out of language syntax highlighting when the end of a code block is detected:
Also includes work to fix fenced code blocks where the size of the trailing fence is larger than the size of the starting fence:
And cases such as:
Possibly fixed issues include #9457, #8903, #8259, #13149, and others
This is not something we'd want to take into the current months release. I'd like to get some usage in insiders builds and target next month's release.