Can pandoc normalise HTML links when converting Markdown to ePub3? #10958
-
Hello there. I'm using pandoc to convert Markdown (as CommonMark) to ePub3. Because the ePub3 format creates one embedded xhtml file per section of the collated original Markdown document, cross-section links to headings must be rewritten by pandoc in order to remain functional in the resulting ePub file. Pandoc indeed does this rewriting for links in Markdown format, but doesn't do so for links in HTML format within a Markdown document. Is there any way to cause pandoc to do such rewriting in this circumstance? A minimal example follows. Consider a Markdown file named
This pandoc invocation will generate an ePub file:
In the resulting ePub file, the first link (in Markdown format) will work as expected. The second link (in HTML format) will not; in order to work, pandoc would need to rewrite it to target Thank you for reading. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi Matt,
As you can see, pandoc parses the second link as a |
Beta Was this translation helpful? Give feedback.
Hi Matt,
Thanks for explaining the problem you are facing so clearly. You can see how your example Markdown document is parsed into pandoc's AST by converting to the
native
format: