diff --git a/xml/title.go b/xml/title.go index e04d9ab..7f00a11 100644 --- a/xml/title.go +++ b/xml/title.go @@ -8,6 +8,7 @@ import ( "time" "github.com/gomarkdown/markdown/ast" + "github.com/gomarkdown/markdown/html" "github.com/mmarkdown/mmark/mast" ) @@ -83,7 +84,7 @@ func (r *Renderer) TitleAuthor(w io.Writer, a mast.Author) { r.outTag(w, "") r.outs(w, "
") diff --git a/xml2/title.go b/xml2/title.go index ae36861..82f9703 100644 --- a/xml2/title.go +++ b/xml2/title.go @@ -4,6 +4,7 @@ import ( "io" "github.com/gomarkdown/markdown/ast" + "github.com/gomarkdown/markdown/html" "github.com/mmarkdown/mmark/mast" "github.com/mmarkdown/mmark/xml" ) @@ -53,7 +54,7 @@ func (r *Renderer) titleBlock(w io.Writer, t *mast.Title) { attrs = xml.Attributes([]string{"abbrev"}, []string{d.Abbrev}) r.outTag(w, "") // use a fake xml rendering to hook into the generation of these title elements @@ -67,11 +68,11 @@ func (r *Renderer) titleBlock(w io.Writer, t *mast.Title) { faker.TitleDate(w, d.Date) r.outs(w, "") - r.outs(w, d.Area) + html.EscapeHTML(w, []byte(d.Area)) r.outs(w, "") r.outs(w, "") - r.outs(w, d.Workgroup) + html.EscapeHTML(w, []byte(d.Workgroup)) r.outs(w, "") faker.TitleKeyword(w, d.Keyword)