mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 08:26:40 +00:00
fix: check content
This commit is contained in:
@@ -728,17 +728,18 @@
|
||||
(:block/pre-block? block)
|
||||
(:block/content block)))))
|
||||
([format pre-block? content]
|
||||
(let [content (if pre-block? content
|
||||
(str (config/get-block-pattern format) " " (string/triml content)))
|
||||
content (property/remove-properties format content)
|
||||
ast (->> (format/to-edn content format nil)
|
||||
(map first))
|
||||
title (when (heading-block? (first ast))
|
||||
(:title (second (first ast))))]
|
||||
(cond->
|
||||
{:block/body (vec (if title (rest ast) ast))}
|
||||
title
|
||||
(assoc :block/title title)))))
|
||||
(when content
|
||||
(let [content (if pre-block? content
|
||||
(str (config/get-block-pattern format) " " (string/triml content)))
|
||||
content (property/remove-properties format content)
|
||||
ast (->> (format/to-edn content format nil)
|
||||
(map first))
|
||||
title (when (heading-block? (first ast))
|
||||
(:title (second (first ast))))]
|
||||
(cond->
|
||||
{:block/body (vec (if title (rest ast) ast))}
|
||||
title
|
||||
(assoc :block/title title))))))
|
||||
|
||||
(defn macro-subs
|
||||
[macro-content arguments]
|
||||
|
||||
Reference in New Issue
Block a user