fix: --output-json no longer escapes for HTML context#484
Merged
shreddedbacon merged 1 commit intomainfrom Feb 5, 2026
Merged
Conversation
CGoodwin90
approved these changes
Jan 20, 2026
7354de3 to
3680ab3
Compare
3680ab3 to
5854110
Compare
Member
|
#485 i think broke the output for this, this fixes it index d61c07f..1f1d5e3 100644
--- a/pkg/output/main_test.go
+++ b/pkg/output/main_test.go
@@ -138,7 +138,8 @@ func TestRenderString(t *testing.T) {
output := RenderString(testData, outputOptions)
checkEqual(t, output, testSuccess1, " render string processing failed")
- var testSuccess2 = `"Plain string message"`
+ var testSuccess2 = `"Plain string message"
+`
outputOptions.JSON = true
output = RenderString(testData, outputOptions)``` |
shreddedbacon
requested changes
Feb 3, 2026
Member
shreddedbacon
left a comment
There was a problem hiding this comment.
Needs some checking on the failure
5854110 to
b613086
Compare
Member
Author
|
Since this changes how JSON is printed, it will probably break tests again with #486, if you wanna merge that one first. |
Member
I'll let you rebase/fix as required for this one then. Once I get the notification of your update I'll run through the review again. |
b613086 to
9f02212
Compare
shreddedbacon
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General Checklist
The existing JSON renderer uses the default Go
json.Marshal()which escapes content assuming it will be in an HTML context. This causes URLs to be invalid in a cli context.Closing issues
n/a