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
This commit is contained in:
Ihor Radchenko 2022-10-22 12:55:11 +08:00
parent 524e0e0b7b
commit 2f5e7103e5
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 8 additions and 4 deletions

View File

@ -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