summaryrefslogtreecommitdiff
path: root/vendor/github.com/yuin/goldmark/renderer/html/html.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/yuin/goldmark/renderer/html/html.go')
-rw-r--r--vendor/github.com/yuin/goldmark/renderer/html/html.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/yuin/goldmark/renderer/html/html.go b/vendor/github.com/yuin/goldmark/renderer/html/html.go
index 8738c2a1b..75ac6dbfa 100644
--- a/vendor/github.com/yuin/goldmark/renderer/html/html.go
+++ b/vendor/github.com/yuin/goldmark/renderer/html/html.go
@@ -786,7 +786,14 @@ func RenderAttributes(w util.BufWriter, node ast.Node, filter util.BytesFilter)
_, _ = w.Write(attr.Name)
_, _ = w.WriteString(`="`)
// TODO: convert numeric values to strings
- _, _ = w.Write(util.EscapeHTML(attr.Value.([]byte)))
+ var value []byte
+ switch typed := attr.Value.(type) {
+ case []byte:
+ value = typed
+ case string:
+ value = util.StringToReadOnlyBytes(typed)
+ }
+ _, _ = w.Write(util.EscapeHTML(value))
_ = w.WriteByte('"')
}
}