diff --git a/encode_vm.go b/encode_vm.go index ace6e73..eef71ab 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -301,11 +301,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte if err != nil { return nil, errMarshaler(code, err) } - if e.enabledHTMLEscape { - b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) - } else { - b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) - } + b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) b = encodeComma(b) } code = code.next @@ -3501,7 +3497,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte } } b = append(b, code.key...) - b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) + b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) b = encodeComma(b) code = code.next } @@ -3532,7 +3528,7 @@ func (e *Encoder) run(ctx *encodeRuntimeContext, b []byte, code *opcode) ([]byte } } b = append(b, code.key...) - b = encodeEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) + b = encodeNoEscapedString(b, *(*string)(unsafe.Pointer(&bytes))) b = encodeComma(b) code = code.next } diff --git a/encode_vm_indent.go b/encode_vm_indent.go index 69b2208..1955437 100644 --- a/encode_vm_indent.go +++ b/encode_vm_indent.go @@ -4165,7 +4165,7 @@ func (e *Encoder) runIndent(ctx *encodeRuntimeContext, b []byte, code *opcode) ( if err := compact(&buf, bb, e.enabledHTMLEscape); err != nil { return nil, err } - b = encodeEscapedString(b, buf.String()) + b = encodeNoEscapedString(b, buf.String()) b = encodeIndentComma(b) code = code.next case opStructFieldStringTagMarshalText: