Browse Source

ox-odt: Improve link generation in 4e5c737311

* lisp/ox-odt.el (org-odt-link): Use file: link code branch when
exporting id: links to document property drawers.  Call `org-odt-link'
with equivalent file: link instead of duplicating the existing code.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tiubca$1252$1@ciao.gmane.io
Ihor Radchenko 1 year ago
parent
commit
2f5e7103e5
1 changed files with 8 additions and 4 deletions
  1. 8 4
      lisp/ox-odt.el

+ 8 - 4
lisp/ox-odt.el

@@ -2738,11 +2738,15 @@ INFO is a plist holding contextual information.  See
 		   (org-export-get-reference destination info)
 		   (or desc (org-export-get-ordinal destination info))))
           ;; Link to a file, corresponding to string return value of
-          ;; `org-export-resolve-id-link'.
+          ;; `org-export-resolve-id-link'.  Export it is file link.
           (plain-text
-           (format "<text:a xlink:type=\"simple\" xlink:href=\"%s\">%s</text:a>"
-		   destination
-		   (or desc (org-export-get-ordinal destination info))))
+           (let ((file-link (org-element-copy link)))
+             (org-element-put-property file-link :type "file")
+             (org-element-put-property file-link :path destination)
+             (org-element-put-property
+              file-link
+              :raw-link (format "file:%s" destination))
+             (org-odt-link file-link desc info)))
 	  ;; Fuzzy link points to some element (e.g., an inline image,
 	  ;; a math formula or a table).
 	  (otherwise