This commit is contained in:
Alessandro Leite 2017-01-23 19:57:31 +01:00
commit 1c5f0e50da
2 changed files with 11 additions and 7 deletions

View File

@ -9,3 +9,4 @@ install:
- go get github.com/russross/blackfriday - go get github.com/russross/blackfriday
- go get github.com/PuerkitoBio/goquery - go get github.com/PuerkitoBio/goquery
- go get github.com/gorilla/mux - go get github.com/gorilla/mux
- go get github.com/microcosm-cc/bluemonday

View File

@ -8,6 +8,7 @@ import (
"text/template" "text/template"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/microcosm-cc/bluemonday"
"github.com/russross/blackfriday" "github.com/russross/blackfriday"
) )
@ -59,6 +60,7 @@ func generateHTML() {
input, _ := ioutil.ReadFile(readmePath) input, _ := ioutil.ReadFile(readmePath)
body := string( body := string(
bluemonday.UGCPolicy().SanitizeBytes(
blackfriday.Markdown( blackfriday.Markdown(
input, input,
blackfriday.HtmlRenderer( blackfriday.HtmlRenderer(
@ -68,6 +70,7 @@ func generateHTML() {
), ),
bfMDOpts, bfMDOpts,
), ),
),
) )
c := &content{Body: body} c := &content{Body: body}