Repository navigation
fix(markdown_parser): render <br> tags as real line breaks - #16972
Open
sanketpatel32 wants to merge 1 commit into
Open
sanketpatel32 wants to merge 1 commit into
sanketpatel32 wants to merge 1 commit into
Conversation
Raw <br> tags in markdown previously rendered as literal text. Parse <br>, <br/>, and <br /> (case-insensitive) as inline line-break tokens: paragraphs split into separate lines at each break, and table cells degrade to a separating space since cells are single-line. Resolves warpdotdev#13732
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @sanketpatel32 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
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.
Description
Renders inline
<br>tags as real line breaks in markdown text.<br>was not tokenized by the inline parser, so agent messages (and other markdown surfaces) showing HTML-style line breaks rendered the tag literally instead of breaking the line.The inline tokenizer now recognizes
<br>/<br/>/<br />(case-insensitive) and emits a\ninside the fragment text. After inline styles are resolved, paragraph lines are split on\ninto separateFormattedTextLines — so emphasis spanning a break (**bold<br>text**) keeps its styling on both resulting lines. Consecutive<br>tags produce blank lines, and a trailing<br>ends the line without inventing an extra blank one. Inside table cells (which are single-line by design) a<br>degrades to a separating space; inside code spans it stays literal text.Linked Issue
Resolves #13732
ready-to-specorready-to-implement.Testing
Added unit tests in
crates/markdown_parser/src/markdown_parser_tests.rscovering:<br>,<br/>, and<br />variants<br>producing a blank line<br>inside a table cell degrading to a space<br>inside a code span staying literalcargo test -p markdown_parser— all 160 tests pass.cargo clippy -p markdown_parserclean.Manual verification via a temporary example binary driving
parse_markdownthrough the sameFormattedTextoutput the renderers consume:./script/run./script/runrequires a GPU-backed display and a signed-in session, which is not available in my headless Linux environment, so GUI-level manual testing wasn't possible; verification is via the automated tests and the render-path demo above.Agent Mode
CHANGELOG-BUG-FIX: Render
<br>tags as line breaks in agent markdown output