mirror of https://github.com/logseq/logseq
chore: add sanitization options
parent
f70d4c6bac
commit
56584121e6
|
@ -25,9 +25,18 @@
|
|||
f))
|
||||
hiccup))
|
||||
|
||||
(def sanitization-options (clj->js {:ADD_TAGS ["iframe"]
|
||||
:ALLOW_UNKNOWN_PROTOCOLS true
|
||||
:ADD_ATTR ["allow"
|
||||
"src"
|
||||
"allowfullscreen"
|
||||
"frameborder"
|
||||
"scrolling"
|
||||
"target"]}))
|
||||
|
||||
(defn sanitize-html
|
||||
[html]
|
||||
(.sanitize DOMPurify html))
|
||||
(.sanitize DOMPurify html sanitization-options))
|
||||
|
||||
;; HTML:
|
||||
;; Example 1:
|
||||
|
|
Loading…
Reference in New Issue