Repository navigation
Turn \r\n and \r in values into line breaks too - #207
Merged
Merged
Conversation
Only \n became a w:br. A value with Windows line endings kept a stray \r next to each break, and one with bare \r had no breaks at all, since the XML parser turns a raw \r into whitespace. Normalise both to \n before the line breaks are added, for plain strings and RichText alike. Fixes #1
cvas22
force-pushed
the
fix/1-carriage-return-break
branch
from
November 25, 2026 09:07
b73b01e to
6c3d7eb
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.
resolve_listing()only turned\ninto<w:br/>. With Windows line endings each break kept a stray\rthat the XML parser turns into a newline in the text, and with bare\r(#1) there were no breaks at all.Both are now normalised to
\nbefore the line breaks are added. It runs inresolve_listing(), so it covers plain{{ }}strings and RichText the same way. Raw\rcan only come from context values at that point, since the template XML itself has none.Tests cover
\n,\r\nand\rfor a plain string and a RichText. The\r\nand\rcases fail on main.Fixes #1