Refactor naming to match JSONML spec
This commit is contained in:
parent
1a8ba45cad
commit
7a8662edea
|
@ -90,17 +90,17 @@
|
||||||
[jsonml]
|
[jsonml]
|
||||||
(if (number? jsonml)
|
(if (number? jsonml)
|
||||||
jsonml
|
jsonml
|
||||||
(let [[head & args] jsonml
|
(let [[tag-name attributes & children] jsonml
|
||||||
tagnames #{"div" "span" "ol" "li" "table" "tr" "td"}]
|
tagnames #{"div" "span" "ol" "li" "table" "tr" "td"}]
|
||||||
(cond
|
(cond
|
||||||
(contains? tagnames head) (let [[style & children] args]
|
(contains? tagnames tag-name) (into
|
||||||
(into
|
[(keyword tag-name) {:style (-> (js->clj attributes)
|
||||||
[(keyword head) {:style (-> (js->clj style)
|
(get "style")
|
||||||
(get "style")
|
(string->css))}]
|
||||||
(string->css))}]
|
(map jsonml->hiccup)
|
||||||
(map jsonml->hiccup children)))
|
children)
|
||||||
|
|
||||||
(= head "object") [data-structure jsonml]
|
(= tag-name "object") [data-structure jsonml]
|
||||||
:else jsonml))))
|
:else jsonml))))
|
||||||
|
|
||||||
(defn subtree [data title]
|
(defn subtree [data title]
|
||||||
|
|
Loading…
Reference in New Issue