Moritz Schäfer <m...@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.yanta...@posteo.net>
From: Ihor Radchenko <yanta...@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 <m...@moritzs.de>
Link: https://orgmode.org/list/CA+FVMQDBUwCQHFOWieELaB3=4mh2yba66+npcuqwvvv_1hv...@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