From af2ea8647b5cde2fc7928e186ffa0ce885dae0e2 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 2 Dec 2007 16:29:14 +0000 Subject: 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 --- Text/Pandoc/Readers/TeXMath.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Text') 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 -- cgit v1.2.3