mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(fix)org-roam-link-replace-at-point: preseve match-data (#1766)
It lies in between org-in-regexp and replace-match. In some situations, like when the link looks like roam:a s'b, it changes the match-data.
This commit is contained in:
@ -631,7 +631,7 @@ Assumes that the cursor was put where the link is."
|
||||
(goto-char (org-element-property :begin link))
|
||||
(when (and (org-in-regexp org-link-any-re 1)
|
||||
(string-equal type "roam")
|
||||
(setq node (org-roam-node-from-title-or-alias path)))
|
||||
(setq node (save-match-data (org-roam-node-from-title-or-alias path))))
|
||||
(replace-match (org-link-make-string
|
||||
(concat "id:" (org-roam-node-id node))
|
||||
(or desc path))))))))
|
||||
|
Reference in New Issue
Block a user