Allow HTML header attributes in sanitizer
This commit is contained in:
parent
88b6e10c88
commit
e09a8353d2
@ -31,6 +31,7 @@ func ConvertToHTML(md string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := bluemonday.UGCPolicy()
|
p := bluemonday.UGCPolicy()
|
||||||
|
p.AllowAttrs("id").OnElements("h1", "h2", "h3", "h4", "h5", "h6")
|
||||||
html := p.Sanitize(buf.String())
|
html := p.Sanitize(buf.String())
|
||||||
|
|
||||||
return html, nil
|
return html, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user