馃悰 FIX: keep the hard line break after a literal backslash - #417
Open
eeshsaxena wants to merge 1 commit into
Open
馃悰 FIX: keep the hard line break after a literal backslash#417eeshsaxena wants to merge 1 commit into
eeshsaxena wants to merge 1 commit into
Conversation
markdown-it's escape rule leaves the space after a literal backslash unconsumed, so a following two-space hard line break is still detected by the newline rule. This port jumped straight to the generic escape branch, which consumed the space, leaving only one space before the newline. As a result `foo\ \nbar` produced a soft break with a stray backslash-space instead of `foo\<br />`. Port the missing space case.
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.
markdown-it-py renders a literal backslash immediately before a two-space hard line break as a soft break with a stray space, rather than a hard break:
markdown-it's
escaperule has a dedicated case for this: when a\is followed by a space it emits just the backslash and leaves the space unconsumed, so the trailing two-space hard break is still detected by the newline rule (itsescape.mjseven carries a comment to that effect). This port jumped straight to the generic escape branch, which consumed the space and left only one space before the newline, so the hard break was downgraded to a soft break.This ports the missing space case so the output matches markdown-it. I added a regression test in
test_misc.py, and thetest_cmark_specandtest_portsuites still pass.