Repository navigation
fix(render): escape line-start markers only before whitespace - #46
Merged
Merged
Conversation
4.6 out of 5 rendered as 4\.6. #, + and ordered markers open a block only when followed by whitespace, so escape them only then (or at the end of the text run, where the next node may supply it).
chaliy
force-pushed
the
claude/project-thread-ulbh3z
branch
from
October 27, 2026 02:48
b4feb99 to
344cafb
Compare
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.
Requested by Михайло · project thread
What changed
Text that only looks like a block marker at the start of a line is no longer backslash-escaped.
#,+and ordered markers (1.,1)) are escaped only when followed by whitespace or the end of the text run (where the next node could supply the space).>,-and=stay always escaped (quotes, thematic breaks, setext underlines).Why
Regression from #23 found by the eval:
4.6 out of 5 starsrendered as4\.6 out of 5 stars. The backslash is noise for text consumers, and4.6can never open a list.Before / After
4.6 out of 5 stars4\.6 out of 5 stars4.6 out of 5 stars#hashtag\#hashtag#hashtag+1 for this\+1 for this+1 for this1. li1\. li1\. li(unchanged)#then nodeh\# h\# h(unchanged)New tests in
tests/output_safety.rs:line_start_marker_lookalikes_render_verbatim(failed before the fix) andline_start_marker_at_run_end_stays_escaped. The pulldown-cmark oracle still sees exactly one paragraph for every case.cargo test --workspacepasses.Risk
Checklist
Generated by Claude Code