Skip to content

Have ToJson() match the default formatter's escaping behavior - #8

Merged
KodrAus merged 1 commit into
datalust:devfrom
nblumhardt-ro:friendlier-literal-json
Sep 3, 2026
Merged

Have ToJson() match the default formatter's escaping behavior#8
KodrAus merged 1 commit into
datalust:devfrom
nblumhardt-ro:friendlier-literal-json

Conversation

@nblumhardt-ro

Copy link
Copy Markdown

System.Text.Json's default formatting also escapes for HTML and anything non-ASCII (which makes sense as a defense-in-depth strategy in web apps). This doesn't work for a formatting library: content with +, with non-Latin character sets, etc., becomes unreadable.

The PR relaxes this to regular safe JSON escaping (the Unsafe*** is a misnomer, in my humble opinion, but a good signpost to make us think, I guess).

… unusable for non-Latin languages, otherwise).

Assisted-by: Claude:claude-fable-5-1
@KodrAus
KodrAus merged commit 333145f into datalust:dev Sep 3, 2026
1 check 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.

2 participants