diff options
Diffstat (limited to 'vendor/github.com/microcosm-cc/bluemonday/sanitize.go')
| -rw-r--r-- | vendor/github.com/microcosm-cc/bluemonday/sanitize.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go index 1f8d85526..47c31f7da 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/sanitize.go +++ b/vendor/github.com/microcosm-cc/bluemonday/sanitize.go @@ -529,9 +529,11 @@ attrsLoop: if ap.regexp != nil { if ap.regexp.MatchString(htmlAttr.Val) { cleanAttrs = append(cleanAttrs, htmlAttr) + continue attrsLoop } } else { cleanAttrs = append(cleanAttrs, htmlAttr) + continue attrsLoop } } } @@ -762,10 +764,10 @@ attrsLoop: switch elementName { case "audio", "img", "link", "script", "video": var crossOriginFound bool - for _, htmlAttr := range cleanAttrs { + for i, htmlAttr := range cleanAttrs { if htmlAttr.Key == "crossorigin" { crossOriginFound = true - htmlAttr.Val = "anonymous" + cleanAttrs[i].Val = "anonymous" } } @@ -1087,3 +1089,8 @@ func normaliseElementName(str string) string { `"`, ) } + +type stringWriterWriter interface { + io.Writer + io.StringWriter +} |
