mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix)db: don't consider links in ROAM_REFS as links (#1947)
Links within ROAM_REFS are no longer added as links into the database. This prevents self-referencing. Links within other properties are still valid.
This commit is contained in:
@ -342,6 +342,10 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
|||||||
;; Links correctly recognized by Org Mode
|
;; Links correctly recognized by Org Mode
|
||||||
((eq type 'link)
|
((eq type 'link)
|
||||||
(setq link element))
|
(setq link element))
|
||||||
|
;; Prevent self-referencing links in ROAM_REFS
|
||||||
|
((and (eq type 'node-property)
|
||||||
|
(string-equal (org-element-property :key element) "ROAM_REFS"))
|
||||||
|
nil)
|
||||||
;; Links in property drawers and lines starting with #+. Recall that, as for Org Mode v9.4.4, the
|
;; Links in property drawers and lines starting with #+. Recall that, as for Org Mode v9.4.4, the
|
||||||
;; org-element-type of links within properties drawers is "node-property" and for lines starting with
|
;; org-element-type of links within properties drawers is "node-property" and for lines starting with
|
||||||
;; #+ is "keyword".
|
;; #+ is "keyword".
|
||||||
@ -354,7 +358,7 @@ If UPDATE-P is non-nil, first remove the file in the database."
|
|||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(delay-mode-hooks (org-mode))
|
(delay-mode-hooks (org-mode))
|
||||||
(insert link)
|
(insert link)
|
||||||
(goto-char 1)
|
(point-min)
|
||||||
(setq link (org-element-context)))))
|
(setq link (org-element-context)))))
|
||||||
(when link
|
(when link
|
||||||
(dolist (fn fns)
|
(dolist (fn fns)
|
||||||
|
Reference in New Issue
Block a user