diff options
Diffstat (limited to 'internal/api/activitypub/users/repliesget_test.go')
-rw-r--r-- | internal/api/activitypub/users/repliesget_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/api/activitypub/users/repliesget_test.go b/internal/api/activitypub/users/repliesget_test.go index ac25f3617..d20d8c6c0 100644 --- a/internal/api/activitypub/users/repliesget_test.go +++ b/internal/api/activitypub/users/repliesget_test.go @@ -266,11 +266,16 @@ func toJSON(a any) string { } a = m } - b, err := json.MarshalIndent(a, "", " ") + var dst bytes.Buffer + enc := json.NewEncoder(&dst) + enc.SetIndent("", " ") + enc.SetEscapeHTML(false) + err := enc.Encode(a) if err != nil { panic(err) } - return string(b) + dst.Truncate(dst.Len() - 1) // drop new-line + return dst.String() } // indentJSON will return indented JSON from raw provided JSON. |