summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/markdown2pdf.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs
index 79cd09a2d..7bcbf4a82 100644
--- a/src/markdown2pdf.hs
+++ b/src/markdown2pdf.hs
@@ -64,12 +64,12 @@ runLatexRaw file = do
runLatex :: FilePath -> IO (Either String FilePath)
runLatex file = step 3
where
- step 0 = return $ Left "Limit of attempts reached"
step n = do
result <- runLatexRaw file
case result of
Left (Left err) -> return $ Left err
- Left (Right _ ) -> step (n-1 :: Int)
+ Left (Right _) | n > 1 -> step (n-1 :: Int)
+ Left (Right msg) -> return $ Left msg
Right pdfFile -> return $ Right pdfFile
checkLatex :: String -> (Bool, Bool, Bool, String)