Closed aproehl79 closed 8 years ago
I'm sorry. It had been a mistake PR #4 . Consideration was not enough.
https://github.com/dfinke/vscode-pandoc/blob/master/src/extension.ts#L54-56
How is it in something like this?
- var inFile = path.join(filePath, fileName).replace(/ /g, '\\ ');
- var outFile = path.join(filePath, fileNameOnly).replace(/ /g, '\\ ') + '.' + qpSelection.label;
+ var inFile = path.join(filePath, fileName).replace(/(^.*$)/gm,"\"" + "$1" + "\"");
+ var outFile = (path.join(filePath, fileNameOnly) + '.' + qpSelection.label).replace(/(^.*$)/gm,"\"" + "$1" + "\"");
I have confirmed that HTML file has been created.
debug console output: (Sorry, Containing the Japanese.
Windows 10:
c:\Users\kazus\Desktop\新しいフォルダー\test 2.md
'c:\Users\kazus\Desktop\新しいフォルダー\test 2.md'
debug: inFile = "c:\Users\kazus\Desktop\新しいフォルダー\test 2.md"
debug: outFile = "c:\Users\kazus\Desktop\新しいフォルダー\test 2.html"
debug: outFile2 = C:\Program Files (x86)\Microsoft VS Code\"c:\Users\kazus\Desktop\新しいフォルダー\test 2.html"
debug: pandoc "c:\Users\kazus\Desktop\新しいフォルダー\test 2.md" -o "c:\Users\kazus\Desktop\新しいフォルダー\test 2.html"
debug: exec pandoc "c:\Users\kazus\Desktop\新しいフォルダー\test 2.md" -o "c:\Users\kazus\Desktop\新しいフォルダー\test 2.html"
Mac OS X:
pdocOptstring = --latex-engine=lualatex -V documentclass=ltjarticle -V geometry:a4paper -V geometry:margin=2.5cm -V geometry:nohead
debug: fullName = /Users/satokaz/ownCloud/00_VSCode/vscode-ext/test/test module/test 2.md
debug: outFile = "/Users/satokaz/ownCloud/00_VSCode/vscode-ext/test/test module/test 2.md"
debug: inFile = "/Users/satokaz/ownCloud/00_VSCode/vscode-ext/test/test module/test 2.pdf"
debug: pandoc "/Users/satokaz/ownCloud/00_VSCode/vscode-ext/test/test module/test 2.md" -o "/Users/satokaz/ownCloud/00_VSCode/vscode-ext/test/test module/test 2.pdf"--latex-engine=lualatex -V documentclass=ltjarticle -V geometry:a4paper -V geometry:margin=2.5cm -V geometry:nohead
Hey,
first of all, great Extension, thank you for that!
I have an issue when filename or path includes whitespaces. Here an example for a file "test 2.md".
[Plugin Host] exec error: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "pandoc c:\Users\Andreas\Desktop\test\ 2.md -o c:\Users\Andreas\Desktop\test\ 2.docx " pandoc: Ignoring: 2.md pandoc: Ignoring: 2.docx pandoc: c:\Users\Andreas\Desktop\test: openBinaryFile: does not exist (No such file or directory)
Andreas