correctly link relative files

This commit is contained in:
Justin Abrahms 2020-11-07 21:54:10 -08:00
parent 156a19c731
commit d56610d7bb
1 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,13 @@
(defun org-gemini--describe-links (links width info)
(mapconcat
(lambda (link)
(let* ((path (org-element-property :raw-link link))
(let* ((raw-path (org-element-property :raw-link link))
(link-type (org-element-property :type link))
(is-org-file-link (and (string= "file" link-type)
(string= ".org" (downcase (file-name-extension raw-path ".")))))
(path (if is-org-file-link
(concat (file-name-sans-extension (org-element-property :path link)) ".gmi")
raw-path))
(desc (org-element-contents link))
(anchor (org-export-data
(or desc (org-element-property :raw-link link))