Skip to content

Commit 7f02d28

Browse files
committed
escape HTML in text op
1 parent ec868ac commit 7f02d28

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module github.com/dchenk/go-render-quill
2+
3+
go 1.13

raw_op.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package quill
22

33
import (
44
"fmt"
5+
"html"
56
"strconv"
67
)
78

@@ -24,7 +25,7 @@ func (ro *rawOp) makeOp(o *Op) error {
2425
case string:
2526
// This op is a simple string insert.
2627
o.Type = "text"
27-
o.Data = ins
28+
o.Data = html.EscapeString(ins)
2829
case map[string]interface{}:
2930
if len(ins) == 0 {
3031
return fmt.Errorf("op %+v lacks a non-text insert", *ro)

0 commit comments

Comments
 (0)