From da57775171d3575816f9b6a0d77fe6872e5d89b7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 12 Nov 2011 13:03:11 -0800 Subject: LaTeX reader: Ignore empty groups {}, { }. Closes #322. --- src/Text/Pandoc/Readers/LaTeX.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 02c7361d7..c965c65ce 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -574,6 +574,7 @@ inline = choice [ str , ensureMath , rawLaTeXInline' , escapedChar + , emptyGroup , unescapedChar , comment ] "inline" @@ -677,6 +678,13 @@ escapedChar = do result <- escaped (oneOf specialChars) return $ if result == Str "\n" then Str " " else result +emptyGroup :: GenParser Char st Inline +emptyGroup = try $ do + char '{' + spaces + char '}' + return $ Str "" + -- nonescaped special characters unescapedChar :: GenParser Char st Inline unescapedChar = oneOf "`$^&_#{}[]|<>" >>= return . (\c -> Str [c]) -- cgit v1.2.3