Skip to content

Commit f4079d7

Browse files
committed
docs: add learning about JSON unicode escaping
Go's json.Marshal escapes >, <, & as unicode by default. Use SetEscapeHTML(false) for shell commands in config files. Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent 2f01c1b commit f4079d7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.context/LEARNINGS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,5 @@ directory component (e.g., `/home/user/ctx/internal/...`).
346346
defer func() { _ = os.Chdir(x) }() to explicitly ignore the error return value.
347347

348348
- **[2026-01-26-0553]** Claude Code settings.local.json hook keys are 'PreToolUse' and 'SessionEnd' (not 'PreToolUseHooks'/'SessionEndHooks'). The 'Hooks' suffix causes 'Invalid key in record' errors.
349+
350+
- **[2026-01-26-0612]** Go's json.Marshal escapes `>`, `<`, and `&` as unicode (\u003e, \u003c, \u0026) by default for HTML safety. Use json.Encoder with SetEscapeHTML(false) when generating config files that contain shell commands like `2>/dev/null`.

0 commit comments

Comments
 (0)