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
This commit is contained in:
fiddlosopher
2007-12-02 16:29:14 +00:00
parent 804756dd1f
commit af2ea8647b
+3 -3
View File
@@ -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