Skip to content

(fix)db: don't consider links in ROAM_REFS as links#1947

Merged
jethrokuan merged 1 commit intomasterfrom
fix/self-referencing
Nov 6, 2021
Merged

(fix)db: don't consider links in ROAM_REFS as links#1947
jethrokuan merged 1 commit intomasterfrom
fix/self-referencing

Conversation

@jethrokuan
Copy link
Copy Markdown
Member

Links within ROAM_REFS are no longer added as links into the database.
This prevents self-referencing. Links within other properties are still
valid.

Closes #1890

Links within ROAM_REFS are no longer added as links into the database.
This prevents self-referencing. Links within other properties are still
valid.
@jethrokuan jethrokuan merged commit 4a2b442 into master Nov 6, 2021
@jethrokuan jethrokuan deleted the fix/self-referencing branch November 6, 2021 10:09
Comment thread org-roam-db.el
(setq link element))
;; Prevent self-referencing links in ROAM_REFS
((and (eq type 'node-property)
(string-equal (org-element-property :key element) "ROAM_REFS"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jethrokuan string-equal is case sensitive (per its docstring).
Are we letting properties to be specified by lower-case?
I use lower-case and this condition returns nil for "roam_refs"...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll submit another PR for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thank you. There are some other places that use string-equal. I'm hoping that it won't cause cascade of changes...

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple non-cite refs on a node cause duplicate self-references in Reflinks

2 participants