git.iko.soy/typeable/pandoc
on master help sign in
markdown2pdf: Better error printing.
e01ae38John MacFarlane
src/markdown2pdf.hs+3−1
@@ -119,7 +119,9 @@ checkLatex "" = (True, False, False, "Could not read log file")
119checkLatex txt = (err , bib, ref, unlines $! msgs ++ tips)
119checkLatex txt = (err , bib, ref, unlines $! msgs ++ tips)
120 where
120 where
121 xs `oneOf` x = any (flip isInfixOf x) xs
121 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
123 tips = checkPackages msgs
125 tips = checkPackages msgs
124 err = any (oneOf ["!", "LaTeX Error:", "Latex Error:"]) msgs
126 err = any (oneOf ["!", "LaTeX Error:", "Latex Error:"]) msgs
125 bib = any (oneOf ["Warning: Citation"
127 bib = any (oneOf ["Warning: Citation"