fix: replace tags with page-refs ignores case

fixes LOG-3073
pull/11102/head
Gabriel Horner 2024-03-01 16:12:29 -05:00
parent b34325be77
commit 82639cb07a
1 changed files with 9 additions and 7 deletions

View File

@ -87,15 +87,17 @@
(string/trim)))
(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]
(reduce
(fn [content tag]
(string/replace content
(str "#" (:block/original-name tag))
(str page-ref/left-brackets
page-ref-special-chars
(:block/uuid tag)
page-ref/right-brackets)))
(common-util/replace-ignore-case
content
(str "#" (:block/original-name tag))
(str page-ref/left-brackets
page-ref-special-chars
(:block/uuid tag)
page-ref/right-brackets)))
content
(sort-by :block/original-name > tags)))