mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-24 07:20:29 +00:00
org-odt-link: Fix relative file links
* lisp/ox-odt.el (org-odt-link): Append an extra "../" to relative links. This is needed to conform with OpenOffice convention to treat base path inside the odt archive. The path containing the odt file is thus "../". Reported-by: Ihor Radchenko <yantar92@posteo.net> Link: https://orgmode.org/list/87ilkc30wd.fsf@localhost
This commit is contained in:
parent
5bc6741a5a
commit
210630e546
@ -2688,7 +2688,14 @@ INFO is a plist holding contextual information. See
|
||||
((member type '("http" "https" "ftp" "mailto"))
|
||||
(concat type ":" raw-path))
|
||||
((string= type "file")
|
||||
(org-export-file-uri raw-path))
|
||||
(let ((path-uri (org-export-file-uri raw-path)))
|
||||
(if (string-prefix-p "file://" path-uri)
|
||||
path-uri
|
||||
;; Otherwise, it is a relative path.
|
||||
;; OpenOffice treats base directory inside the odt
|
||||
;; archive. The directory containing the odt file
|
||||
;; is "../".
|
||||
(concat "../" path-uri))))
|
||||
(t raw-path)))
|
||||
;; Convert & to & for correct XML representation
|
||||
(path (replace-regexp-in-string "&" "&" path)))
|
||||
|
Loading…
Reference in New Issue
Block a user