Split emphasis markers at paragraph breaks, merge heading lines#110
Merged
Split emphasis markers at paragraph breaks, merge heading lines#110
Conversation
When <br><br> (or other paragraph breaks) occur inside <strong> or <em>, the markdown markers must be split so they don't span across breaks. Otherwise, markdown renderers fail to apply the formatting. Before: <strong>hello<br><br>world</strong> → **hello \n \nworld** After: <strong>hello<br><br>world</strong> → **hello** \n \n**world** For headings, line breaks are merged into a single line since markdown headings can't span multiple lines. Before: <h1>foo<br>bar</h1> → # foo \nbar (bar loses heading) After: <h1>foo<br>bar</h1> → # foo bar (all content in heading) Added wrap_with_markers helper in Base class for reuse. Fixes #95 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
Two related fixes for markdown rendering issues when line breaks occur inside formatting tags:
Emphasis (strong/em) with paragraph breaks
When
<br><br>occurs inside<strong>or<em>, markers must be split so they don't span across paragraph breaks.Headings with line breaks
Markdown headings can't span multiple lines, so content is merged into a single line.
Implementation
wrap_with_markershelper in Base class for splitting emphasis at paragraph breaksTest plan
Fixes #95
🤖 Generated with Claude Code