Browse Source

fix: node reference that contains a softline break and tag breaks

the node reference

fixes https://github.com/logseq/db-test/issues/40
Tienson Qin 1 year ago
parent
commit
a1c56c0189
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/main/frontend/components/block.cljs

+ 4 - 3
src/main/frontend/components/block.cljs

@@ -638,11 +638,12 @@
                 s (if (re-find db-content/special-id-ref-pattern s)
                     (db-content/special-id-ref->page s (:block/refs page-entity))
                     s)
-                s (if tag? (str "#" s) s)
-                inline-list (gp-mldoc/inline->edn s (mldoc/get-default-config (get page-entity :block/format :markdown)))]
+                s (if tag? (str "#" s) s)]
             (if (ldb/page? page-entity)
               s
-              (->elem :span (map-inline config inline-list))))))]
+              (let [inline-list (gp-mldoc/inline->edn (first (string/split-lines s))
+                                                      (mldoc/get-default-config (get page-entity :block/format :markdown)))]
+                (->elem :span (map-inline config inline-list)))))))]
      (let [repo (state/get-current-repo)
            block-id (:block/uuid config)
            block (when block-id (db/entity [:block/uuid block-id]))]