Skip to content

Preserve carriage returns through XML output round trips - #32

Merged
zhengchun merged 1 commit into
antchfx:masterfrom
rudycelekli:fix/output-carriage-return-20261101
Nov 8, 2026
Merged

zhengchun merged 1 commit into
antchfx:masterfrom
rudycelekli:fix/output-carriage-return-20261101

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

A JSON string containing a carriage return is written literally to XML; an XML parser then normalizes it to a line feed. Emit a character reference so the exported text survives a standard encoding/xml round trip. The regression also covers CRLF, tab, LF, ampersand and angle brackets.

Validation at fd1c4eadc7052f138b7b294b9c70cdeaa3362159 (base 823396cf97c3b7cfc2fb3d2424a0ac49faf55aeb):

  • Added regression fails on the unchanged base.
  • go test ./... -count=1 passes.
  • go test -race ./... -count=1 passes.
  • git diff --check passes.

Checks above ran locally on macOS; hosted CI and maintainer review remain separate. Prepared and independently reviewed with Codex assistance.

@zhengchun
zhengchun merged commit 95f245a into antchfx:master Nov 8, 2026
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.

2 participants