add allowed styles elements to render html
This commit is contained in:
parent
888ff2ec47
commit
f777cf6d11
@ -81,6 +81,8 @@ func serveEmailHTMLContent(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
policy := bluemonday.UGCPolicy()
|
policy := bluemonday.UGCPolicy()
|
||||||
|
policy.AllowAttrs("style", "color", "bgcolor").OnElements("h1", "h2", "h3", "h4", "h5", "h6", "p", "ul", "ol", "li", "a", "br", "strong", "em", "i", "b", "u", "span", "div", "table", "thead", "tbody", "tr", "th", "td", "img")
|
||||||
|
|
||||||
sanitizedHTML := policy.Sanitize(email.HTML)
|
sanitizedHTML := policy.Sanitize(email.HTML)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user