My problem is similar to this post, but not identical. I somehow can't figure out the correct pandoc command line parameters for maintaining/resolving cross-document links when using a couple of interlinked HTML files as the input.
Let's say I have two files, chapter1.xhtml and chapter2.xhtml located in the /home/user/Documents folder with the following contents:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<h3>Chapter 1</h3>
<p><a href="/home/user/Documents/chapter2.xhtml">Next chapter</a><br /></p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</body>
</html>
which contains a link to the next document.
and
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<h3>Chapter 2</h3>
<p><a href="/home/user/Documents/chapter1.xhtml">Previous chapter</a><br /></p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</body>
</html>
which contains a link to the previous document.
I used the following command line parameters:
$ pandoc -s --toc --verbose -o /home/user/Documents/output.markdown /home/user/Documents/chapter1.xhtml /home/user/Documents/chapter2.xhtml
And I got the following output:
---
---
- [Chapter 1](#chapter-1)
- [Chapter 2](#chapter-2)
### Chapter 1
[Next chapter](/home/user/Documents/chapter2.xhtml)\
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
### Chapter 2
[Previous chapter](/home/user/Documents/chapter1.xhtml)\
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
This problem also occurs when I select docx or latex/pdf as the output format. I also tried to use relative links, but nothing worked.
What are the correct parameters for resolving cross-document links?
tl;dr I.e. I don't want link references that contain the original paths; I want them to point to the new output document.