Skip to content

[5.2] Normalize line endings with a precompiled pattern - #409

Merged
tsegismont merged 1 commit into
5.2from
backport/408-to-5.2
Nov 30, 2026
Merged

tsegismont merged 1 commit into
5.2from
backport/408-to-5.2

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #408 to 5.2
Cherry-picked commit: bb7d1bf

The pattern matches CRLF, CR and LF atomically, which makes the
conversion idempotent: content that already contains the local line
endings, for example when a generator uses println or embeds the
system line separator, is normalized instead of being corrupted with
doubled carriage returns.

The no-op fast path for LF systems is removed: it was only correct
under the assumption that generators never emit the platform line
separator, which cannot be guaranteed for the render() SPI.

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
(cherry picked from commit bb7d1bf)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont merged commit cb4c4de into 5.2 Nov 30, 2026
5 checks passed
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.

1 participant