commit a3515edca30f0c0b625e97e0a487e30fc2b3a895
parent dc893960ab720f0960df53fccb8a9f48af69c707
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 9 Apr 2023 03:27:08 -0700
fix policy
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkg/web/handlers/api/v1/msgInterceptor.go b/pkg/web/handlers/api/v1/msgInterceptor.go
@@ -101,10 +101,11 @@ func ProcessRawMessage(db *database.DkfDB, in, roomKey string, authUserID databa
taggedUsersIDsMap[quoted.UserID] = quoted.User
}
p := bluemonday.NewPolicy()
- p.AllowElements("a", "p", "span", "strong", "del", "code", "pre", "em", "ul", "li", "br")
+ p.AllowElements("a", "p", "span", "strong", "del", "code", "pre", "em", "ul", "li", "br", "small", "i")
p.AllowAttrs("href", "rel", "target").OnElements("a")
p.AllowAttrs("tabindex", "style").OnElements("pre")
p.AllowAttrs("style", "class", "title").OnElements("span")
+ p.AllowAttrs("style").OnElements("small")
html = p.Sanitize(html)
return html, taggedUsersIDsMap, nil
}