fix: add page embeds to page references

This commit is contained in:
Tienson Qin
2021-03-19 22:52:03 +08:00
parent a1d4a4d110
commit 2df3fd297d
4 changed files with 10 additions and 11 deletions

View File

@@ -60,11 +60,11 @@
(and (vector? block)
(= "Macro" (first block)))
(let [{:keys [name arguments]} (second block)]
(when (and (= name "embed")
(string? (first arguments))
(string/starts-with? (first arguments) "[[")
(string/ends-with? (first arguments) "]]"))
(subs (first arguments) 2 (- (count (first arguments)) 2))))
(let [argument (string/join ", " arguments)]
(when (and (= name "embed")
(string? argument)
(text/page-ref? argument))
(text/page-ref-un-brackets! argument))))
:else
nil)]
(when (and