git.iko.soy/typeable/pandoc
on master help sign in
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

commitaf2ea8647b5cde2fc7928e186ffa0ce885dae0e2 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 2 Dec 2007, 16:29 (19 years ago) parent804756d
1 file changed+3−3
Text/Pandoc/Readers/TeXMath.hs+3−3
Text/Pandoc/Readers/TeXMath.hs+3−3
@@ -38,8 +38,8 @@ import Text.Pandoc.Shared
3838
3939-- | Converts a string of raw TeX math to a list of 'Pandoc' inlines.
4040readTeXMath :: String -> [Inline]
41−readTeXMath inp = case parse teXMath "input" inp of
42− Left err -> error $ "\nError:\n" ++ show err
41+readTeXMath inp = case parse teXMath ("formula: " ++ inp) inp of
42+ Left err -> [Str inp] -- if unparseable, just include original
4343 Right res -> res
4444
4545teXMath = manyTill mathPart eof >>= return . concat
@@ -73,7 +73,7 @@ letters = do
7373 return [Emph [Str res]]
7474
7575misc = do
76− res <- noneOf "{}\\"
76+ res <- noneOf "}"
7777 return [Str [res]]
7878
7979scriptArg = try $ do