fix: page refs

pull/6529/head
Tienson Qin 2022-08-31 03:19:15 +08:00
parent 336fa578d5
commit 9e2d6e7cfb
3 changed files with 8 additions and 5 deletions

View File

@ -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))

View File

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

View File

@ -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))))