Skip to content

Escape HTML-sensitive characters in serialized JSON - #29

Merged
rameel merged 1 commit into
mainfrom
escape-json
Aug 21, 2026
Merged

Escape HTML-sensitive characters in serialized JSON#29
rameel merged 1 commit into
mainfrom
escape-json

Conversation

@rameel

@rameel rameel commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Use JavaScriptEncoder with UnicodeRanges.All so JsonSerializer escape only HTML-sensitive characters (<, >, &, ', ", ...), while non-ASCII text (Cyrillic, Arabic, etc.) is no longer escaped to \uXXXX sequences

Use JavaScriptEncoder with UnicodeRanges.All so htmx attributes escape
only HTML-sensitive characters (<, >, &, ', "), while non-ASCII text
(Cyrillic, Arabic, etc.) is no longer escaped to \uXXXX sequences
@rameel
rameel merged commit b2a8f49 into main Aug 21, 2026
1 check passed
@rameel
rameel deleted the escape-json branch August 21, 2026 19:04
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