fix: don't extract and display misleading warnings

in display-type blocks. Was able to reproduce the issue in :code, :quote
and :math blocks. Fixes logseq/db-test#128.
This commit is contained in:
Gabriel Horner
2024-10-01 14:53:18 -04:00
parent 3a8352ee04
commit 9c08e27483

View File

@@ -78,7 +78,12 @@ and handles unexpected failure."
format (or format :markdown)
parse-config (mldoc/get-default-config format)
ast (format/to-edn title format parse-config)
blocks (extract-blocks ast title format {:parse-block block})
;; 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}))
new-block (first blocks)
block (cond->
(merge block new-block)