Closed stlehmann closed 8 years ago
I can confirm this issue. Having a markdown file with relative paths to images and converting it to pdf results in errors: "pandoc: Could not find image".
However, if I open the console and type:
import os
os.chdir("/path/to/where/my/markdown/file/is")
If I then run pandoc to pdf, it works.
So indeed, changing the current directory before running would be a nice feature!
Hello there, I've encountered the same issue and I made a quick fix in the Pandoc.py
file by adding a regex replacement that works just fine (for me, I'm on Windows).
It's all thanks to @rubenvandeven for finding this issue out!
Pandoc_py_file.zip
I did the following :
line 43
: def run(self):
if self.window.active_view():
#Modification attempt
curr_fullpath = self.window.extract_variables()['file_path']
regexpath = re.compile('\\\\|\\|\/')
fixd_fullpath = regexpath.sub('/',curr_fullpath)
os.chdir(fixd_fullpath)
# ---
self.window.show_quick_panel(
self.transformations(),
self.transform)
Of course, I'm waiting for an official fix from the developper.
I was about to make a change and create a pull request, but then noticed that #37 is already waiting to be merged. @tbfisher, could you please do that? Thank you for this great plugin!
see #37
I get an error when trying to convert my Markdown file with relative image pathes. In my oppinion the reason is that the current directory is net set to the docuemts directory before starting pandoc. This should be done in order to allow relative file imports in future versions.