Skip to content

Commit

Permalink
fix: escape inner double quotes
Browse files Browse the repository at this point in the history
Fix for zk-org#389
  • Loading branch information
flytaly committed Aug 7, 2024
1 parent 7ae8a39 commit 5d08da9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/core/util.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package core

import "strconv"

// lazyStringer implements Stringer and wait for String() to be called the first
// time before computing its value.
type lazyStringer struct {
Expand All @@ -24,5 +26,5 @@ func (s *lazyStringer) String() string {
}

func (s *lazyStringer) MarshalJSON() ([]byte, error) {
return []byte(`"` + s.String() + `"`), nil
return []byte(strconv.Quote(s.String())), nil
}

0 comments on commit 5d08da9

Please sign in to comment.