git.iko.soy/typeable/pandoc
on master help sign in
markdown2pdf: Better error printing.

This goes with the earlier change to -halt-on-error.

commite01ae38a77a6e818b0a4ca3726dff5206b3b85d9 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 22 Jul 2011, 10:30 (15 years ago) parent5eec45e
1 file changed+3−1
src/markdown2pdf.hs+3−1
src/markdown2pdf.hs+3−1
@@ -119,7 +119,9 @@ checkLatex "" = (True, False, False, "Could not read log file")
119119checkLatex txt = (err , bib, ref, unlines $! msgs ++ tips)
120120 where
121121 xs `oneOf` x = any (flip isInfixOf x) xs
122− msgs = filter (oneOf ["Error:", "Warning:"]) (lines txt)
122+ msgs = dropWhile (not . errorline) $ lines txt
123+ errorline ('!':_) = True
124+ errorline _ = False
123125 tips = checkPackages msgs
124126 err = any (oneOf ["!", "LaTeX Error:", "Latex Error:"]) msgs
125127 bib = any (oneOf ["Warning: Citation"