Reputation: 11763
Pandoc is a great tool to transform files from one format to another. Among all the diverse functions it provides, one interesting function is to generate self-contained portable HTML file. This function is very useful when you want to share your HTML files with your colleagues. However, when the link contains full path file. For example, the html file original.html contains the following HTML items:
<a href="file:///media/distribution/file_num.png" target="_blank" />
<img src="file:///media/distribution/file_num.png" /></a>
When I use pandoc original.html --self-contained -o transformed.html
to generate a portable HTML file, the following error message is given:
pandoc: Could not fetch file:///media/distribution/file_num.png
InvalidUrlException"file:///media/distribution/file_num.png" "Invalid scheme".
Any ideas? Thanks.
EDIT: I also tried to use pypandoc,
output=pypandoc.convert_file('data.html','html',outputfile="ddd.html",extra_args=['--self-contained'])
but the same error happens:
'Pandoc died with exitcode "%s" during conversion: %s' % (p.returncode, stderr)
RuntimeError: Pandoc died with exitcode "61" during conversion:
Upvotes: 0
Views: 260