emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2


From: Ihor Radchenko
Subject: Re: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9.5.2/)]
Date: Wed, 19 Oct 2022 10:36:11 +0000

Moritz Schäfer <mail@moritzs.de> writes:

> Thanks for getting back to me on this.
>
> Here is a minimal example. In org-roam (v2), when having a file/node:

Thanks! An example helps a lot.

Can you try the attached patch against the latest main branch?

>From 4e5c7373115cfeb88fb4392252d682fad8d178a8 Mon Sep 17 00:00:00 2001
Message-Id: 
<4e5c7373115cfeb88fb4392252d682fad8d178a8.1666175750.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Wed, 19 Oct 2022 18:33:44 +0800
Subject: [PATCH] ox-odt: Allow id: links to files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/ox-odt.el (org-odt-link): Transcode id: links to file property
drawers.

Reported-by: Moritz Schäfer <mail@moritzs.de>
Link: 
https://orgmode.org/list/CA+FVMQDBUwCQHFOWieELaB3=4MH2ybA66+NpCuQwvvv_1HVMzg@mail.gmail.com
---
 lisp/ox-odt.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 208a39d9d..4ff667640 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2737,6 +2737,12 @@ (defun org-odt-link (link desc info)
           (format "<text:a xlink:type=\"simple\" 
xlink:href=\"#%s\">%s</text:a>"
                   (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'.
+          (plain-text
+           (format "<text:a xlink:type=\"simple\" 
xlink:href=\"%s\">%s</text:a>"
+                  destination
+                  (or desc (org-export-get-ordinal destination info))))
          ;; Fuzzy link points to some element (e.g., an inline image,
          ;; a math formula or a table).
          (otherwise
-- 
2.35.1


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]