Skip to content

Commit

Permalink
Merge pull request #118 from Quaver/sanitize-br
Browse files Browse the repository at this point in the history
Allow br tag
  • Loading branch information
AiAe authored Oct 26, 2024
2 parents 81d2b26 + fd76b99 commit f669749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stringutil/sanitize.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/microcosm-cc/bluemonday"
func SanitizeHTML(html string) string {
p := bluemonday.NewPolicy()

p.AllowElements("p", "b", "strong", "i", "em", "u", "ul", "ol", "li", "s", "a", "img", "table", "tr", "td", "center")
p.AllowElements("p", "b", "strong", "i", "em", "u", "ul", "ol", "li", "s", "a", "img", "table", "tr", "td", "center", "br")
p.AllowAttrs("style").OnElements("p")
p.AllowAttrs("href").OnElements("a")
p.AllowAttrs("src", "alt", "width", "height", "style").OnElements("img")
Expand Down

0 comments on commit f669749

Please sign in to comment.