mirror of https://github.com/logseq/logseq
parent
b34325be77
commit
82639cb07a
|
@ -87,15 +87,17 @@
|
||||||
(string/trim)))
|
(string/trim)))
|
||||||
|
|
||||||
(defn replace-tags-with-page-refs
|
(defn replace-tags-with-page-refs
|
||||||
"Replace tags in content with page-ref ids"
|
"Replace tags in content with page-ref ids. Ignore case because tags in
|
||||||
|
content can have any case and still have a valid ref"
|
||||||
[content tags]
|
[content tags]
|
||||||
(reduce
|
(reduce
|
||||||
(fn [content tag]
|
(fn [content tag]
|
||||||
(string/replace content
|
(common-util/replace-ignore-case
|
||||||
(str "#" (:block/original-name tag))
|
content
|
||||||
(str page-ref/left-brackets
|
(str "#" (:block/original-name tag))
|
||||||
page-ref-special-chars
|
(str page-ref/left-brackets
|
||||||
(:block/uuid tag)
|
page-ref-special-chars
|
||||||
page-ref/right-brackets)))
|
(:block/uuid tag)
|
||||||
|
page-ref/right-brackets)))
|
||||||
content
|
content
|
||||||
(sort-by :block/original-name > tags)))
|
(sort-by :block/original-name > tags)))
|
||||||
|
|
Loading…
Reference in New Issue