mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
Filter out iframe tag on markdown rendering
This commit is contained in:
3
utils.go
3
utils.go
@@ -338,10 +338,9 @@ func sanitizeXSS(html string) string {
|
||||
p := bluemonday.UGCPolicy()
|
||||
p.AllowStyling()
|
||||
p.RequireNoFollowOnLinks(false)
|
||||
p.AllowElements("video", "source", "iframe")
|
||||
p.AllowElements("video", "source")
|
||||
p.AllowAttrs("controls", "width").OnElements("video")
|
||||
p.AllowAttrs("src", "width").OnElements("source")
|
||||
p.AllowAttrs("src", "frameborder").OnElements("iframe")
|
||||
return p.Sanitize(html)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user