mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 02:06:32 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user