Hello!

Here comes another (tiny) patch which fixes generation of external links to relative file paths.

Apparently =./Media/logo.png= has to be inserted as =href=../Media/logo.png=.

At least on LibreOffice 3 and 4 anything else fails. LibreOffice always shows and uses the absolute path and prefixes the stored relative path with the path to the =.odt= file
*including the filename itself*!

So the =../= removes the filename and the link gets calculated correctly.

Best Regards,

    Georg Lehner

- - -

--- /home/jorge/progs/org-mode/lisp/ox-odt.el
+++ /home/jorge/emacs/lib/org-mode/lisp/ox-odt.el
@@ -2763,7 +2780,7 @@
         ((string= type "file")
          (if (file-name-absolute-p raw-path)
              (concat "file://" (expand-file-name raw-path))
-           (concat "file://" raw-path)))
+           (concat "file:" "../" raw-path)))
         (t raw-path)))
      ;; Convert & to & for correct XML representation
      (path (replace-regexp-in-string "&" "&" path))


Reply via email to