{{ message }}
Repository navigation
fix(db): keep $ in page titles when replacing id refs - #13816
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
Titles were passed as string/replace replacements, so $$, $&, $` and $' in a page title were expanded as JS replacement patterns.
tiensonqin
force-pushed
the
fix/literal-dollar-in-ref-titles
branch
from
October 21, 2026 13:26
3467819 to
a329b8f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

id-ref->title-refandcontent-id-ref->pagepassed a page title toclojure.string/replaceas the replacement string. JavaScript expands$$,$&,$`and$'in a replacement string, so a page titledcost$$resolved to[[cost$]], anda$&bresolved to[[a[[<uuid>]]b]]. When a page is deleted,content-id-ref->pagewrites the changed title back to every block that referenced it.This change adds a private
replace-literalhelper that matches the escaped string as a regex and inserts the title through a fn, so the title is inserted as is.Tests
id-ref->title-ref-testandcontent-id-ref->page-testindeps/db/test/logseq/db/frontend/content_test.cljscover$$,$&,$`and$'in page refs and tags.deps/db: 202 tests, 775 assertions, 0 failures.deps/outliner: 158 tests, 808 assertions, 0 failures.clj-kondo --lint src testindeps/db: 0 errors, 0 warnings.Fixes logseq/db-test#1461