Commit 91cafac
authored
fix: preserve URL query strings in invoke output (#54)
## Summary
- Fixes pretty-printed `kernel invoke` output escaping `&` as `\\u0026`
(and similarly `<`, `>`), which breaks copy/paste of URLs returned in
invocation output (e.g. replay URLs).
- Switches JSON pretty-printing to a custom encoder with
`SetEscapeHTML(false)`.
## Why
Go's default `json.MarshalIndent` escapes HTML-sensitive characters.
When the CLI re-marshals invocation output for pretty printing, URLs
like `...?jwt=...&replay_id=...` can show up as
`...?jwt=...\\u0026replay_id=...`.
## Test plan
- `go test ./...`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Prevents HTML character escaping in pretty-printed invoke results by
using a custom JSON encoder to preserve URL characters.
>
> - **CLI – `cmd/invoke.go`**:
> - Use custom JSON encoder for `printResult` with
`SetEscapeHTML(false)` and indentation to avoid escaping `&`, `<`, `>`
in pretty-printed output; trims trailing newline.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f3502a4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent ce0cf8c commit 91cafac
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
199 | 207 | | |
200 | 208 | | |
201 | 209 | | |
| |||
0 commit comments