(fix): only update relative path of file links (#1226)

This commit is contained in:
Matt Chowning
2020-11-03 11:07:31 -05:00
committed by GitHub
parent 56c47fbff8
commit 7c83a84db3
2 changed files with 3 additions and 1 deletions

View File

@ -1321,7 +1321,8 @@ replaced links are made relative to the current buffer."
(when-let ((link (org-element-lineage (org-element-context) '(link) t)))
(let ((type (org-element-property :type link))
(path (org-element-property :path link)))
(when (and (f-relative-p path)
(when (and (string= type "file")
(f-relative-p path)
(org-in-regexp org-link-bracket-re 1))
(let* ((file-path (expand-file-name path (file-name-directory old-path)))
(new-path (org-roam-link-get-path file-path)))