fix: Texts after a macro are shifted to a new line

close #3512
This commit is contained in:
Tienson Qin
2021-12-27 16:31:11 +08:00
parent 5526df769d
commit f02d233b57

View File

@@ -717,8 +717,10 @@
(if macro-content
(let [ast (->> (mldoc/->edn macro-content (mldoc/default-config format))
(map first))
block? (mldoc/block-with-title? (ffirst ast))]
(if block?
paragraph? (and (= 1 (count ast))
(= "Paragraph" (ffirst ast)))]
(if (and (not paragraph?)
(mldoc/block-with-title? (ffirst ast)))
[:div
(markup-elements-cp (assoc config :block/format format) ast)]
(inline-text format macro-content)))