aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-11-12 13:03:11 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-11-12 13:03:11 -0800
commitda57775171d3575816f9b6a0d77fe6872e5d89b7 (patch)
tree5cab2503697d9845e2b6b52b9319240e365c9ff9 /src
parent8ed33f66623778f910eac5a0235b15b336c66278 (diff)
downloadpandoc-da57775171d3575816f9b6a0d77fe6872e5d89b7.tar.gz
LaTeX reader: Ignore empty groups {}, { }.
Closes #322.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs8
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])