Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Miek Gieben <[email protected]>
  • Loading branch information
miekg committed Aug 24, 2018
1 parent 55241ed commit 6da6b5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion xml/title.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/gomarkdown/markdown/ast"
"github.com/gomarkdown/markdown/html"
"github.com/mmarkdown/mmark/mast"
)

Expand Down Expand Up @@ -83,7 +84,7 @@ func (r *Renderer) TitleAuthor(w io.Writer, a mast.Author) {
r.outTag(w, "<author", attrs)

r.outTag(w, "<organization", Attributes([]string{"abbrev"}, []string{a.OrganizationAbbrev}))
r.outs(w, a.Organization)
html.EscapeHTML(w, []byte(a.Organization))
r.outs(w, "</organization>")

r.outs(w, "<address>")
Expand Down
7 changes: 4 additions & 3 deletions xml2/title.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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, "<title", attrs)
r.outs(w, d.Title)
html.EscapeHTML(w, []byte(d.Title))
r.outs(w, "</title>")

// use a fake xml rendering to hook into the generation of these title elements
Expand All @@ -67,11 +68,11 @@ func (r *Renderer) titleBlock(w io.Writer, t *mast.Title) {
faker.TitleDate(w, d.Date)

r.outs(w, "<area>")
r.outs(w, d.Area)
html.EscapeHTML(w, []byte(d.Area))
r.outs(w, "</area>")

r.outs(w, "<workgroup>")
r.outs(w, d.Workgroup)
html.EscapeHTML(w, []byte(d.Workgroup))
r.outs(w, "</workgroup>")

faker.TitleKeyword(w, d.Keyword)
Expand Down

0 comments on commit 6da6b5c

Please sign in to comment.