Skip to content

Commit

Permalink
fix(editor): more support for html convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jul 4, 2022
1 parent e3b749e commit 8e3b8f0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/main/frontend/extensions/html_parser.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
[hiccup]
(walk/postwalk (fn [f]
(if (map? f)
(dissoc f :style)
(apply dissoc f (conj (filter (fn [key]
(string/starts-with? (str key) ":data-"))
(keys f))
:style
:class))
f)) hiccup))

(defn- export-hiccup
Expand Down Expand Up @@ -144,12 +148,19 @@
:span} %))
(emphasis-transform tag attrs children)

:code (if @*inside-pre?
:code (cond
@*inside-pre?
(map-join children)

(string? (first children))
(let [pattern (config/get-code format)]
(str " "
(str pattern (first children) pattern)
" ")))
" "))

;; skip monospace style, since it has more complex children
:else
(map-join children))

:pre
(do
Expand All @@ -174,6 +185,9 @@
:li
(str "- " (map-join children))

:br
"\n"

:dt
(case format
:org (str "- " (map-join children) " ")
Expand Down

0 comments on commit 8e3b8f0

Please sign in to comment.