From e01ae38a77a6e818b0a4ca3726dff5206b3b85d9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Jul 2011 10:30:06 -0700 Subject: markdown2pdf: Better error printing. This goes with the earlier change to -halt-on-error. --- src/markdown2pdf.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index faae544e7..4866b4163 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -119,7 +119,9 @@ checkLatex "" = (True, False, False, "Could not read log file") checkLatex txt = (err , bib, ref, unlines $! msgs ++ tips) where xs `oneOf` x = any (flip isInfixOf x) xs - msgs = filter (oneOf ["Error:", "Warning:"]) (lines txt) + msgs = dropWhile (not . errorline) $ lines txt + errorline ('!':_) = True + errorline _ = False tips = checkPackages msgs err = any (oneOf ["!", "LaTeX Error:", "Latex Error:"]) msgs bib = any (oneOf ["Warning: Citation" -- cgit v1.2.3