refactor: hiccup to html

pull/6773/head^2
Konstantinos Kaloutas 2022-10-06 16:43:13 +03:00 committed by Andelf
parent 60790763dd
commit d70c291d8e
1 changed files with 8 additions and 6 deletions

View File

@ -1523,6 +1523,12 @@
"Highlight" :mark)]
(->elem elem (map-inline config data))))
(defn hiccup->html
[s]
(-> (safe-read-string s)
(hiccups.core/html)
(security/sanitize-html)))
(defn inline
[{:keys [html-export?] :as config} item]
(match item
@ -1580,9 +1586,7 @@
(ui/catch-error
[:div.warning {:title "Invalid hiccup"} s]
[:span {:dangerouslySetInnerHTML
{:__html (-> (safe-read-string s)
(hiccups.core/html)
(security/sanitize-html))}}])
{:__html (hiccup->html s)}}])
["Inline_Html" s]
(when (not html-export?)
@ -3319,9 +3323,7 @@
[:div.warning {:title "Invalid hiccup"}
content]
[:div.hiccup_html {:dangerouslySetInnerHTML
{:__html (-> (safe-read-string content)
(hiccups.core/html)
(security/sanitize-html))}}])
{:__html (hiccup->html content)}}])
["Export" "latex" _options content]
(if html-export?