mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-13 11:14:37 -05:00
sanitize markdown
This commit is contained in:
parent
bc3434bb6a
commit
7cee227b4a
1 changed files with 10 additions and 7 deletions
3
repo.go
3
repo.go
|
@ -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}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue