aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-09-09 19:23:55 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-09-09 19:23:55 -0700
commit4076e2f8be37b9e6e7b96d7a89c958740beb600c (patch)
tree772f1a32aad08c0fbf330c80cee83a5879de96f3 /src/Text
parent14dba12f9058790a5ea4d29d44e044b5f1213c23 (diff)
downloadpandoc-4076e2f8be37b9e6e7b96d7a89c958740beb600c.tar.gz
LaTeX reader: Better error messages for environments.
Now it should tell you that it was looking for \end{env}, instead of giving "unknown parse error."
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index b0a3a97e6..86ae400de 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -801,7 +801,9 @@ descItem = do
return (ils, [bs])
env :: String -> LP a -> LP a
-env name p = p <* (controlSeq "end" *> braced >>= guard . (== name))
+env name p = p <*
+ (try (controlSeq "end" *> braced >>= guard . (== name))
+ <?> ("\\end{" ++ name ++ "}"))
listenv :: String -> LP a -> LP a
listenv name p = try $ do