summaryrefslogtreecommitdiff
path: root/src/markdown2pdf.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-02 18:19:28 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-02 18:19:28 +0000
commit907077709186381e655ede4685efc5af9fbd871d (patch)
treed730f86e7738476b3c012570c83071dd4052b023 /src/markdown2pdf.hs
parent77396199e746e5aa4489e6d483bec6157448bc82 (diff)
markdown2pdf.hs: throw error if pandoc --dump-args does.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1781 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/markdown2pdf.hs')
-rw-r--r--src/markdown2pdf.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs
index 769139508..0333b121f 100644
--- a/src/markdown2pdf.hs
+++ b/src/markdown2pdf.hs
@@ -34,7 +34,7 @@ run file opts = do
parsePandocArgs :: [String] -> IO (Maybe ([String], String))
parsePandocArgs args = do
result <- run "pandoc" $ ["--dump-args"] ++ args
- return $ either (const Nothing) (parse . map trim . lines) result
+ return $ either error (parse . map trim . lines) result
where parse [] = Nothing
parse ("-":[]) = Just ([], "stdin") -- no output or input
parse ("-":x:xs) = Just (x:xs, dropExtension x) -- no output
@@ -43,11 +43,11 @@ parsePandocArgs args = do
trim = takeWhile (/='\r') . dropWhile (=='\r')
runPandoc :: [String] -> FilePath -> IO (Either String FilePath)
-runPandoc inputs output = do
+runPandoc inputsAndArgs output = do
let texFile = replaceExtension output "tex"
result <- run "pandoc" $
["-s", "--no-wrap", "-r", "markdown", "-w", "latex"]
- ++ inputs ++ ["-o", texFile]
+ ++ inputsAndArgs ++ ["-o", texFile]
return $ either Left (const $ Right texFile) result
runLatexRaw :: String -> FilePath -> IO (Either (Either String String) FilePath)