aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-12-02 16:29:14 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-12-02 16:29:14 +0000
commitaf2ea8647b5cde2fc7928e186ffa0ce885dae0e2 (patch)
tree182231c0cbb619f71fd31da3cb4251d2be79f85a
parent804756dd1f51ab261fcdf5a32f4426229389d394 (diff)
downloadpandoc-af2ea8647b5cde2fc7928e186ffa0ce885dae0e2.tar.gz
Small fix to error handling in TeXMath parser:
+ misc now parses anything but a '}' character + if there's a TeX parsing error, the string is included verbatim and no error is issued. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1135 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Text/Pandoc/Readers/TeXMath.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Text/Pandoc/Readers/TeXMath.hs b/Text/Pandoc/Readers/TeXMath.hs
index 347fde42d..a143e6089 100644
--- a/Text/Pandoc/Readers/TeXMath.hs
+++ b/Text/Pandoc/Readers/TeXMath.hs
@@ -38,8 +38,8 @@ import Text.Pandoc.Shared
-- | Converts a string of raw TeX math to a list of 'Pandoc' inlines.
readTeXMath :: String -> [Inline]
-readTeXMath inp = case parse teXMath "input" inp of
- Left err -> error $ "\nError:\n" ++ show err
+readTeXMath inp = case parse teXMath ("formula: " ++ inp) inp of
+ Left err -> [Str inp] -- if unparseable, just include original
Right res -> res
teXMath = manyTill mathPart eof >>= return . concat
@@ -73,7 +73,7 @@ letters = do
return [Emph [Str res]]
misc = do
- res <- noneOf "{}\\"
+ res <- noneOf "}"
return [Str [res]]
scriptArg = try $ do