lierdakil/pandoc-crossref

ulr-encoded anchors in OOXML output

kappapiana opened this issue · 2 comments

Not sure it's a pandoc-crossref, pandoc or Libreoffice issue, but using internal section references, the resulting ancor in OOXML would point to something like w:name="w:name="sec:sec_sow:a"".

Then I open the document and links work fine

However, if I just save the unmodified document in Libreoffice the : character gets URL-encoded as %3A and results in w:name="sec%3Asec_sow%3Aa" and the internal link gets broken. But since I gather this is something related to compliance, wouldn't it be safer to use the same conversion, since we are dealing with URLs?

OOXML is docx IIRC, so I'm a little confused about you using Libreoffice. Are you opening docx in Libreoffice, or is the problem with odt output?

In any case, I think this issue would be better solved upstream, there's very little docx-specific code in pandoc-crossref, and I don't think adding more is the solution here.

Yes, I am using LO to open docx/OOXML (within a script, but it's not relevant).

My query was more on why not URL-encode the links anyway. This way it would not be changed and the internal reference will be kept intact. Actually what LO does seems rational, probably even mandated by a standard, since URLs cannot contain colon.

But you are right, it's probably a pandoc issue.