Fix hiccup structure

This commit is contained in:
Saskia Lindner 2017-09-21 15:17:04 +02:00 committed by Daniel Compton
parent 019ebc7748
commit a9306075b3
1 changed files with 7 additions and 6 deletions

View File

@ -36,14 +36,15 @@
(if (number? jsonml)
jsonml
(let [[head & args] jsonml
tagnames #{"span" "ol" "li" "div"}]
tagnames #{"div" "span" "ol" "li" "table" "tr" "td"}]
(cond
(contains? tagnames head) (let [[style & children] args]
[(keyword head) {:style (-> (js->clj style)
(get "style")
(string->css))}
(into [:div {:style {:display "inline-block"}}]
(mapv jsonml->hiccup children))])
(into
[(keyword head) {:style (-> (js->clj style)
(get "style")
(string->css))}]
(map jsonml->hiccup children)))
(= head "object") [data-structure jsonml]
(= jsonml ", ") " "
:else jsonml))))