markup/goldmark: Escape image alt attribute

Fixes #9594
This commit is contained in:
Joe Mooring
2022-03-02 09:30:57 -08:00
committed by Bjørn Erik Pedersen
parent 883e71c96a
commit e46e9ceb29
2 changed files with 30 additions and 1 deletions

View File

@@ -175,7 +175,7 @@ func (r *hookedRenderer) renderImageDefault(w util.BufWriter, source []byte, nod
_, _ = w.Write(util.EscapeHTML(util.URLEscape(n.Destination, true)))
}
_, _ = w.WriteString(`" alt="`)
_, _ = w.Write(n.Text(source))
_, _ = w.Write(util.EscapeHTML(n.Text(source)))
_ = w.WriteByte('"')
if n.Title != nil {
_, _ = w.WriteString(` title="`)