Skip to content

Preserve plain newlines for breaks inside preformatted blocks - #312

Open
Aschenbath wants to merge 1 commit into
matthewwithanm:developfrom
Aschenbath:codex/oss20e-20261122-markdownify-pre-breaks
Open

Aschenbath wants to merge 1 commit into
matthewwithanm:developfrom
Aschenbath:codex/oss20e-20261122-markdownify-pre-breaks

Conversation

@Aschenbath

Copy link
Copy Markdown

Convert <br> inside a converted <pre> to a plain newline, preserving code contents instead of introducing literal backslashes or spaces from Markdown hard-break syntax. Preserve ordinary break behavior when pre conversion is disabled.

Fixes #311.

Seven regression cases fail before the fix, covering both newline styles, nested code/span tags and mixed br forms. The complete suite passes: 103 tests on Python 3.12 with Beautiful Soup 4.15.0. Focused Ruff checks on the new tests pass.

Prepared with OpenAI Codex assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line breaks inside preformatted blocks insert literal Markdown break characters

1 participant