chore: add sanitization options

pull/6773/head^2
Konstantinos Kaloutas 2022-10-06 11:41:11 +03:00 committed by Andelf
parent f70d4c6bac
commit 56584121e6
1 changed files with 10 additions and 1 deletions

View File

@ -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: