mirror of
https://github.com/logseq/logseq.git
synced 2026-05-21 03:12:38 +00:00
12 lines
387 B
Clojure
12 lines
387 B
Clojure
(ns frontend.security
|
|
"Provide security focused fns like preventing XSS attacks"
|
|
(:require ["dompurify" :as DOMPurify]))
|
|
|
|
(def sanitization-options (clj->js {:ADD_TAGS ["iframe"]
|
|
:ADD_ATTR ["is"]
|
|
:ALLOW_UNKNOWN_PROTOCOLS true }))
|
|
|
|
(defn sanitize-html
|
|
[html]
|
|
(.sanitize DOMPurify html sanitization-options))
|