fix: unable to add a comment using # in codeblocks

fixes https://github.com/logseq/db-test/issues/168
This commit is contained in:
Tienson Qin
2024-12-15 21:08:24 +08:00
parent 1f86f47c3d
commit 277096d458
2 changed files with 4 additions and 3 deletions

View File

@@ -77,13 +77,13 @@ and handles unexpected failure."
(let [block (dissoc block :block/pre-block?)
format (or format :markdown)
parse-config (mldoc/get-default-config format)
ast (format/to-edn title format parse-config)
;; Disable extraction for display-type blocks as there isn't a reason to have
;; it enabled yet and can cause visible bugs when '#' is used
blocks (if (and (config/db-based-graph? (state/get-current-repo))
(:logseq.property.node/display-type block))
[block]
(extract-blocks ast title format {:parse-block block}))
(let [ast (format/to-edn title format parse-config)]
(extract-blocks ast title format {:parse-block block})))
new-block (first blocks)
block (cond->
(merge block new-block)