pypandoc icon indicating copy to clipboard operation
pypandoc copied to clipboard

pypandoc > 1.6.4 breaks relative media links

Open lmende opened this issue 3 years ago • 2 comments

with: [WARNING] Could not fetch resource ./plantuml/951024a08973cc301dbab7d20b52fd3a.svg: PandocResourceNotFound "./plantuml/951024a08973cc301dbab7d20b52fd3a.svg"

Steps to reproduce:

  1. string with html_content:
html_content = '''
<h2>foobar</h2><p><img src="./plantuml/951024a08973cc301dbab7d20b52fd3a.svg" class="uml" alt="uml diagram" title="" /></p>
'''
  1. convert with

output = pypandoc.convert_text(
                    html_content,
                    to='docx',
                    format='html',
                    outputfile= 'huhu.docx',
                )

produces docx w/o image even if I provide kwarg cworkdir. Conversion with pandoc on cmd line works.

lmende avatar Sep 16 '22 08:09 lmende

@lmende can you confirm that you have set the "--resource-path" options?

In addition, I can't seem to figure out, why specifically pypandoc > 1.6.4 would break this.

JessicaTegner avatar Sep 23 '22 08:09 JessicaTegner

Setting sandbox=False fixed it for me, but see my full comment here

sanjass avatar Dec 24 '22 20:12 sanjass