-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODT: relative links #3524
Comments
I have broken relative links when converting from docbook to odt. Is this the same issue? |
I'm using pandoc 2.2.3.2. Here an example to reproduce the problem on windows:
It works when the first line is replaced with this
This seems like a LibreOffice error, but they cannot correct it because there are already too many documents out there. So I think pandoc should consider this special behavior of LibreOffice as ODT spec There is no problem with docx. |
Does anyone have an idea why full path with the file name is treated as |
Related: https://bz.apache.org/ooo/show_bug.cgi?id=98211 Key point:
|
Here is the section 2.7 from ODT spec: Usage of IRIs Within PackagesWithin the files contained in a package, relative IRIs may be used to OpenDocument Package Consumers shall resolve relative IRIs that occur
then the relative IRI shall interpreted as a package file entry
Note: File whose relative path starts with “META-INF/” are |
If this is all correct, then the fix is simple: we just need to add a |
Nice to fix this five-year-old bug! |
@jgm, thank you for the fix of the ODT writer. Doesn't the reader need a similar change? Despite the issue is tagged only as "writer", the original report describes a case of ODT to HTML conversion as well. |
Oh yes, then it probably does! |
Don't alter the link if the path is empty.
ODT adds a `../` to relative links (see #3524); this needs to be removed when converting from ODT.
Hi,
I'm using pandoc version 1.19.2.1.
When generating ODT file with relative link to some document that link is wrongly calculated.
Generating the ODT file
Let's have following directory structure:
For the following DocBook file (
links.xml
):Or HTML file(
lnks.html
):Generated ODT file, which is created in
test
directory, has following content:While these seems to be correct when generated file is opened with LibreOffice the link is unusable.
To have correct link to
test.txt
file LibreOffice (version: 5.3.1.2) expect following structure:So the file path is not
./attachments/test.txt
but it is../attachments/test.txt
.Generating from ODT file
Let's have following directory structure:
Where l
links.odt
is file created with LibreOffice and contains link totest.txt
file:Following is the content of HTML file generated with command:
pandoc -s -f odt -t html test/links.odt -o test/links.html
And expected is:
The text was updated successfully, but these errors were encountered: