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