mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
move sanitizeXSS() to markdown.go
This commit is contained in:
11
utils.go
11
utils.go
@@ -14,7 +14,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"github.com/puzpuzpuz/xsync/v3"
|
||||
"mvdan.cc/xurls/v2"
|
||||
|
||||
@@ -339,16 +338,6 @@ func linkQuotes(input string) string {
|
||||
})
|
||||
}
|
||||
|
||||
func sanitizeXSS(html string) string {
|
||||
p := bluemonday.UGCPolicy()
|
||||
p.AllowStyling()
|
||||
p.RequireNoFollowOnLinks(false)
|
||||
p.AllowElements("video", "source")
|
||||
p.AllowAttrs("controls", "width").OnElements("video")
|
||||
p.AllowAttrs("src", "width").OnElements("source")
|
||||
return p.Sanitize(html)
|
||||
}
|
||||
|
||||
func basicFormatting(input string, skipNostrEventLinks bool, usingTelegramInstantView bool, skipLinks bool) string {
|
||||
nostrMatcher := nostrEveryMatcher
|
||||
if skipNostrEventLinks {
|
||||
|
||||
Reference in New Issue
Block a user