Browse Source

fix: page refs

Tienson Qin 3 years ago
parent
commit
9e2d6e7cfb

+ 4 - 1
deps/graph-parser/src/logseq/graph_parser/extract.cljc

@@ -167,7 +167,10 @@
             properties (let [properties (and (gp-property/properties-ast? first-block)
                                              (->> (last first-block)
                                                   (map (fn [[x y mldoc-ast]]
-                                                         [x (text/parse-property x y mldoc-ast user-config)]))
+                                                         (let [k (if (keyword? x)
+                                                                   (subs (str x) 1)
+                                                                   x)]
+                                                           [(string/lower-case k) (text/parse-property k y mldoc-ast user-config)])))
                                                   (into {})
                                                   (walk/keywordize-keys)))]
                          (when (and properties (seq properties))

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/text.cljs

@@ -149,7 +149,7 @@
       (seq refs)
       refs
 
-      non-string-property
+      (some? non-string-property)
       non-string-property
 
       (and (= k "file-path")

+ 3 - 3
src/test/frontend/db/query_dsl_test.cljs

@@ -298,15 +298,15 @@ prop-d:: nada"}])
   (load-test-files
    [{:file/path "pages/page1.md"
      :file/content "---
-tags: [[page-tag-1]], page-tag-2
+tags: [[page-tag-1]], [[page-tag-2]]
 ---"}
     {:file/path "pages/page2.md"
      :file/content "---
-tags: page-tag-2, [[page-tag-3]]
+tags: [[page-tag-2]], [[page-tag-3]]
 ---"}
     {:file/path "pages/page3.md"
      :file/content "---
-tags: other
+tags: [[other]]
 ---"}])
 
   (are [x y] (= (set y) (set (map :block/name (dsl-query x))))