Max Nikulin <> writes:

> I am sorry. I confused this thread with some other bug report. I agree 
> that the original post describes namely file links. When Moritz provided 
> an example in response to your request for more details I decided that 
> more similar problems are coming. Perhaps particular use case does not 
> include links to specific headings in files and I was wrong. On the 
> other hand if ox-odt code works with id links better than ox-html then 
> the former may be a source of inspiration how to fix the latter.

I am not sure which bug you are referring to.

>> Here, we at least fix the export error. So that people can at least get
>> some exported .odt file.
> I have tried main HEAD (your fix should be applied) and I did not get an 
> error, but the result is quite strange. Consider a single file with an 
> internal link:
> :ID:       3c885843-13ad-4dd8-a57f-de8271403b85
> :END:
> #+TITLE: Note A
> * H 1
> Some text
> * H 2
> [[id:3c885843-13ad-4dd8-a57f-de8271403b85][Link to Note A]]
> Link in the exported document:
> <text:a xlink:type="simple" xlink:href="">Link to Note 
> A</text:a>
> I would expect a target withing the same .odt file.
> Properties as displayed in LibreOffice UI are even more peculiar:
> Document path
> file:///tmp/d/test-odt.odt/
> Target in document is empty.
> My expectation for path is file:///tmp/d/test-odt.odt or at least 
> file:///tmp/d/, but certainly not their combination. I am 
> unsure if you consider this observation as relevant to this thread.

I improved the code a bit, directly reusing file: link transcoder:

However, it does not change your observed behaviour.

I also tried the following Org file, and it looks like something is wrong
about file: link export in ox-odt. Even file: links have the erroneous
document path.

Probably, is treated as a link to resource packed inside
.odt file.
I tried to look through, but I
cannot see any obvious correct way to link to external files from odt.
May someone more familiar with ODT schema take a look?

:ID:       3c885843-13ad-4dd8-a57f-de8271403b85
#+TITLE: Note A

* H 1
Some text

* H 2
[[id:3c885843-13ad-4dd8-a57f-de8271403b85][Link to Note A]]

Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <>.
Support Org development at <>,
or support my work at <>

Reply via email to