1
0
Tienson Qin 10 сар өмнө
parent
commit
665d7a817c

+ 4 - 3
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs

@@ -20,7 +20,8 @@
             [logseq.db.test.helper :as db-test]
             [logseq.db.frontend.rules :as rules]
             [logseq.common.util.date-time :as date-time-util]
-            [logseq.graph-parser.block :as gp-block]))
+            [logseq.graph-parser.block :as gp-block]
+            [logseq.db.frontend.content :as db-content]))
 
 ;; Helpers
 ;; =======
@@ -495,7 +496,7 @@
       (is (= 2
              (->> (find-block-by-content @conn #"replace with same start string")
                   :block/title
-                  (re-seq #"\[\[~\^\S+\]\]")
+                  (re-seq db-content/id-ref-pattern)
                   distinct
                   count))
           "A block with ref names that start with same string has 2 distinct refs")
@@ -503,7 +504,7 @@
       (is (= 1
              (->> (find-block-by-content @conn #"replace case insensitive")
                   :block/title
-                  (re-seq #"\[\[~\^\S+\]\]")
+                  (re-seq db-content/id-ref-pattern)
                   distinct
                   count))
           "A block with different case of same ref names has 1 distinct ref"))

+ 1 - 1
docs/dev-practices.md

@@ -377,7 +377,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
   ```sh
   $ bb dev:db-query woot '[:find (pull ?b [*]) :where (block-content ?b "Dogma")]'
   DB contains 833 datoms
-  [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/title "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
+  [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/title "Dogma #[[65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d]]", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
   ```
 
 * `dev:db-transact` - Run a `d/transact!` against the queried results of a DB graph

+ 0 - 1
src/main/frontend/handler/common/page.cljs

@@ -20,7 +20,6 @@
             [frontend.modules.outliner.ui :as ui-outliner-tx]
             [frontend.modules.outliner.op :as outliner-op]
             [frontend.handler.db-based.editor :as db-editor-handler]
-            [logseq.db.frontend.content :as db-content]
             [logseq.common.util.page-ref :as page-ref]
             [frontend.handler.notification :as notification]))