Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: JSON block string encoding #843

Merged
merged 13 commits into from
Jul 15, 2024
Prev Previous commit
Next Next commit
tidy
  • Loading branch information
mattjohnsonpint committed Jul 2, 2024
commit 0424a0b456c34a5df7f58eb3ff8f8fb7dcc121c6
5 changes: 1 addition & 4 deletions v2/pkg/ast/ast_value.go
Original file line number Diff line number Diff line change
@@ -146,12 +146,9 @@ func (d *Document) writeJSONValue(buf *bytes.Buffer, value Value) error {
}
case ValueKindString:
if d.StringValueIsBlockString(value.Ref) {
s := d.StringValueContentString(value.Ref)

enc := json.NewEncoder(buf)
enc.SetEscapeHTML(false)
err := enc.Encode(s)
if err != nil {
if err := enc.Encode(d.StringValueContentString(value.Ref)); err != nil {
return err
}