From 7c83a84db3038b4ac0fd11ae97a04144053f4932 Mon Sep 17 00:00:00 2001 From: Matt Chowning Date: Tue, 3 Nov 2020 11:07:31 -0500 Subject: [PATCH] (fix): only update relative path of file links (#1226) --- CHANGELOG.md | 1 + org-roam.el | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6494d6..5aecf8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - [#1195](https://github.com/org-roam/org-roam/issues/1195) fix ID face showing as invalid if within Org ID files, but not Org-roam's. - [#1199](https://github.com/org-roam/org-roam/issues/1199) make Org-roam link insertions respect `org-roam-link-title-format` everywhere. - [#1201](https://github.com/org-roam/org-roam/issues/1201) fix `org-roam-db-build-cache` failing in scenarios involving duplicate IDs and deleted files. +- [#1226](https://github.com/org-roam/org-roam/issues/1226) only update relative path of file links ## 1.2.2 (06-10-2020) diff --git a/org-roam.el b/org-roam.el index 147f00a..05ff873 100644 --- a/org-roam.el +++ b/org-roam.el @@ -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)))