Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Image Paths do not work for docx or epub #288

Closed
antiskid56 opened this issue Jun 28, 2022 · 2 comments
Closed

Relative Image Paths do not work for docx or epub #288

antiskid56 opened this issue Jun 28, 2022 · 2 comments

Comments

@antiskid56
Copy link

In converting a markdown file to docx or epub, I run into PandocResourceNotFound for images with a relative path.

I can duplicate this issue with pandoc itself, by running pandoc from a directory other than the one where the input markdown file is.

With pandoc itself, I can solve the problem, by specifying a nondefault extension. The from file type changes from markdown to markdown+rebase_relative_paths. Here rebase_relative_paths is the nondefault extension.

But there seems to be no way to specify any pandoc extension in this way with pypandoc. The code that normalizes the from file types does not seem to allow it.

In any case, I haven't found a workaround for this issue. Does someone else have a workaround?

Thanks.

@JessicaTegner
Copy link
Owner

Hi there.
When setting the input or output format with pypandoc, you can also set extensions like you did in your example

@antiskid56
Copy link
Author

Thanks for your prompt response.

After additional testing and research, I think the real issue is the "--sandbox" parameter that is being passed to pandoc by default. If I disable this, by passing sandbox=False in the pypandoc argument list, then pandoc finds the image file as one would expect.

If I don't disable this, there is no workaround that will fix the problem.

I think the top-level documentation should prominently mention this issue and its workaround. Currently it does not. I had to dig through commit messages and source code to find this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants