Repository navigation
Fix alerts containing nested blockquotes - #781
Open
Rajatendu1 wants to merge 1 commit into
Open
Rajatendu1 wants to merge 1 commit into
Rajatendu1 wants to merge 1 commit into
Conversation
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.
An alert containing a nested blockquote is closed at the nested quote's
</blockquote>, rather than the matching outer tag. This leaves crossed tags and moves the rest of the alert outside its container.For example, with
extras=["alerts"]:Match the closing blockquote at the opening tag's indentation.
_block_quote_sub()indents nested quotes by two spaces, so this keeps the complete nested quote inside the alert. Preserve the opening indentation when replacing the block. Alert marker recognition and the rest of the quote parser are unchanged.Added a native
tm-casesfixture covering a quote in an alert, a quote as its first block, an alert inside an ordinary quote, a list-contained alert, and a nested alert. The fixture fails on current master and passes with this change. Includes a changelog entry.Validation on Linux, Python 3.10.12:
cd test && python3 test.py -- -knownfailure: 303 tests pass. The same run on master with the new fixture has one failure; master without it passes 302 tests.python3 test_redos.py: 12 tests pass.The native harness excludes unavailable
wavedrom,latex2mathmlandemojitests, plus old-Pygments fixtures incompatible with installed Pygments 2.21.0. Other Python versions, full tox matrix and lint were not run (pycodestyleis unavailable). Expected HTML retains the renderer's whitespace-only indented lines, as existing fixtures do.Found by source inspection and local reproductions, not a production incident. AI assistance was used for investigation, implementation and testing.