I've got a lot of markdown files which contain spaces in the filenames. Those don't behave correctly when I use 'html+'.
Here is a patch that seems to make things work by adding quotes around the filename as part of the exec call.
diff --git a/autoload/pandoc_exec.vim b/autoload/pandoc_exec.vim
index 0da5031..6b5d122 100644
--- a/autoload/pandoc_exec.vim
+++ b/autoload/pandoc_exec.vim
@@ -13,12 +13,13 @@ import re, string
import shlex
from os.path import exists, relpath, basename, splitext
from subprocess import call, Popen, PIPE
+import pipes
pandoc_variable_substitutions = {
# current file
- "%%": lambda r: relpath(vim.current.buffer.name),
+ "%%": lambda r: pipes.quote(relpath(vim.current.buffer.name)),
# current file, w/o extension
- "%:r": lambda r: splitext(relpath(vim.current.buffer.name))[0],
+ "%:r": lambda r: pipes.quote(splitext(relpath(vim.current.buffer.name))[0]),
# the values in b:pandoc_bibfiles, as arguments for a pandoc-compatible program
"PANDOC#P_BIBS" : lambda r: " ".join(["--bibliography "+ i for i in vim.eval('b:pandoc_bibfiles')]),
# the values in b:pandoc_bibfiles, as a list
I've got a lot of markdown files which contain spaces in the filenames. Those don't behave correctly when I use 'html+'.
Here is a patch that seems to make things work by adding quotes around the filename as part of the exec call.