Brett on 13 Jul, 2018 04:03 PM
Marked does do some processing on image paths, both before and after the
main processor runs. If a path is relative, it tries to flesh out the
path based on document location or a Base: metadata tag. This is
primarily because it needs to find the images to watch them for changes,
but also to accommodate a few inconsistencies in the way that different
processors handle things like spaces in paths.
However, if the output you're showing is what it's leaving, I'm not
certain that it's making the change. If you open Help->Custom Processor
Log, do the image paths being output by Pandoc directly differ from
what's showing up in the preview?
Using the metadata base: might help, and not require you to change the
Let me know if your processor log differs from the output. You can also
right click and inspect the broken image to see the path that the
preview itself is using, which may differ from the source or export
I made a few additional tests and I think I can say it's an issue with Pandoc and not Marked 2.
In my configs there was a difference between Terminal Pandoc command and Marked 2 preview with Pandoc as processor: Pandoc command had a --self-contained option that was missing in Marked 2 processor args.
Once I added the --self-contained option to Marked 2 processor args the preview showed the image correctly.
So if you don't use the --self-contained option Pandoc seems to succeed in locating the image making use of the --resource-path option (Pandoc is not complaining about not finding the image as it does if you remove the --resource-path option) but it doesn't write the HTML <img> correctly and generate the wrong HTML:
Brett on 13 Jul, 2018 08:11 PM
Yes, avoiding writing full, absolute paths is a fair objective :).
Unfortunately, I'm not an in-depth enough user of Pandoc to have dealt
much with these particular settings. Might be worth googling for a more
active group, as people who've already solved an issue or know the
solution aren't typically reading the support tickets for them here...