diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2011-11-12 13:03:11 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2011-11-12 13:03:11 -0800 |
commit | da57775171d3575816f9b6a0d77fe6872e5d89b7 (patch) | |
tree | 5cab2503697d9845e2b6b52b9319240e365c9ff9 /src/Text | |
parent | 8ed33f66623778f910eac5a0235b15b336c66278 (diff) | |
download | pandoc-da57775171d3575816f9b6a0d77fe6872e5d89b7.tar.gz |
LaTeX reader: Ignore empty groups {}, { }.
Closes #322.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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]) |