Heading edit

This commit is contained in:
Tienson Qin
2020-04-23 13:31:17 +08:00
parent 318750b22b
commit 2ea0ccc94e
16 changed files with 369 additions and 330 deletions

View File

@@ -53,12 +53,12 @@
;; TODO create a dummy heading if no headings exists
(defn extract-headings
[blocks]
[blocks last-pos]
(loop [headings []
heading-children []
blocks (reverse blocks)
timestamps {}
last-pos nil]
last-pos last-pos]
(if (seq blocks)
(let [block (first blocks)
level (:level (second block))]

View File

@@ -28,12 +28,14 @@
(.parseJson js/window.MldocOrg content config))))
(defn ->clj
[content]
(if (string/blank? content)
{}
(-> content
(parse-json)
(util/json->clj))))
([content]
(->clj content default-config))
([content config]
(if (string/blank? content)
{}
(-> content
(parse-json config)
(util/json->clj)))))
(defn inline-list->html
[json]