From 621faf90a4fe4249650a2f6de5d7fd4e24e69327 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 15 Dec 2023 14:12:52 +0800 Subject: [PATCH] fix: don't treat a block as pre block if it has auto heading --- .../graph-parser/src/logseq/graph_parser/block.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/deps/graph-parser/src/logseq/graph_parser/block.cljs b/deps/graph-parser/src/logseq/graph_parser/block.cljs index 44ee37f3239..1caad7cfc0f 100644 --- a/deps/graph-parser/src/logseq/graph_parser/block.cljs +++ b/deps/graph-parser/src/logseq/graph_parser/block.cljs @@ -519,6 +519,7 @@ (when (coll? refs) refs)))) (map :block/original-name)) + pre-block? (if (:heading properties) false true) block {:block/uuid id :block/content content :block/level 1 @@ -526,16 +527,16 @@ :block/properties-order (vec properties-order) :block/properties-text-values properties-text-values :block/invalid-properties invalid-properties - :block/pre-block? true + :block/pre-block? pre-block? :block/macros (extract-macros-from-ast body) :block/body body} {:keys [tags refs]} (with-page-block-refs {:body body :refs property-refs} false db date-formatter)] (cond-> block - tags - (assoc :block/tags tags) - true - (assoc :block/refs (concat refs (:block-refs pre-block-properties))))) + tags + (assoc :block/tags tags) + true + (assoc :block/refs (concat refs (:block-refs pre-block-properties))))) (select-keys first-block [:block/format :block/page])) blocks) blocks)] @@ -613,7 +614,7 @@ (str (gp-property/colons-org "id") " " (:block/uuid block)))))] (string/replace-first c replace-str "")))))) -(defn block-exists-in-another-page? +(defn block-exists-in-another-page? "For sanity check only. For renaming file externally, the file is actually deleted and transacted before-hand." [db block-uuid current-page-name]