markdown2pdf: Fixed bug with output file extensions.

Previously 'markdown2pdf test.txt -o test.en.pdf' would produce
'test.pdf', not 'test.en.pdf'.

Thanks to Paolo Tanimoto for the fix.
This commit is contained in:
John MacFarlane 2011-02-04 11:27:20 -08:00
parent d4b71a6423
commit 8e81437fd1

View file

@ -37,7 +37,7 @@ parsePandocArgs args = do
runPandoc :: [String] -> FilePath -> IO (Either String FilePath)
runPandoc inputsAndArgs output = do
let texFile = replaceExtension output "tex"
let texFile = addExtension output "tex"
result <- run "pandoc" $
["-s", "--no-wrap", "-r", "markdown", "-w", "latex"]
++ inputsAndArgs ++ ["-o", texFile]