mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(minor)refactor: make prefix checking clearer (#1951)
This commit is contained in:
@ -470,7 +470,7 @@ INFO is the org-element parsed buffer."
|
||||
(let (rows)
|
||||
(dolist (ref refs)
|
||||
(save-match-data
|
||||
(cond ((string-equal (substring ref 0 1) "@")
|
||||
(cond ((string-prefix-p "@" ref)
|
||||
(push (vector node-id (substring ref 1) "cite") rows))
|
||||
((string-match org-link-plain-re ref)
|
||||
(push (vector node-id (match-string 2 ref) (match-string 1 ref)) rows))
|
||||
|
@ -260,7 +260,7 @@ Return nil if there's no node with such REF."
|
||||
((string-match org-link-plain-re ref)
|
||||
(setq type (match-string 1 ref)
|
||||
path (match-string 2 ref)))
|
||||
((string-equal (substring ref 0 1) "@")
|
||||
((string-prefix-p "@" ref)
|
||||
(setq type "cite"
|
||||
path (substring ref 1))))
|
||||
(when (and type path)
|
||||
|
Reference in New Issue
Block a user