@@ -34,7 +34,7 @@ run file opts = do
3434parsePandocArgs :: [String] -> IO (Maybe ([String], String))
3535parsePandocArgs args = do
3636 result <- run "pandoc" $ ["--dump-args"] ++ args
37− return $ either (const Nothing) (parse . map trim . lines) result
37+ return $ either error (parse . map trim . lines) result
3838 where parse [] = Nothing
3939 parse ("-":[]) = Just ([], "stdin") -- no output or input
4040 parse ("-":x:xs) = Just (x:xs, dropExtension x) -- no output
@@ -43,11 +43,11 @@ parsePandocArgs args = do
4343 trim = takeWhile (/='\r') . dropWhile (=='\r')
4444
4545runPandoc :: [String] -> FilePath -> IO (Either String FilePath)
46−runPandoc inputs output = do
46+runPandoc inputsAndArgs output = do
4747 let texFile = replaceExtension output "tex"
4848 result <- run "pandoc" $
4949 ["-s", "--no-wrap", "-r", "markdown", "-w", "latex"]
50− ++ inputs ++ ["-o", texFile]
50+ ++ inputsAndArgs ++ ["-o", texFile]
5151 return $ either Left (const $ Right texFile) result
5252
5353runLatexRaw :: String -> FilePath -> IO (Either (Either String String) FilePath)