aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-01-31 22:50:51 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-31 22:50:51 -0800
commite752669e50815b0c1bef62fc5b1de95c33317f89 (patch)
tree727bbcabf4878b317fe93863c7de26f1eb7316a0 /src/Text/Pandoc/Readers/LaTeX
parent7c424b315cb814b952d9bd9d5f027beb70169bff (diff)
downloadpandoc-e752669e50815b0c1bef62fc5b1de95c33317f89.tar.gz
LaTeX reader: don't let `\egroup` match `{`.
`braced` now actually requires nested braces. Otherwise some legitimate command and environment definitions can break (see test/command/tex-group.md).
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Parsing.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
index 9437c23d9..a2dd61aee 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -612,19 +612,19 @@ braced' :: PandocMonad m => LP m Tok -> Int -> LP m [Tok]
braced' getTok n =
handleEgroup <|> handleBgroup <|> handleOther
where handleEgroup = do
- t <- egroup
+ t <- symbol '}'
if n == 1
then return []
else (t:) <$> braced' getTok (n - 1)
handleBgroup = do
- t <- bgroup
+ t <- symbol '{'
(t:) <$> braced' getTok (n + 1)
handleOther = do
t <- getTok
(t:) <$> braced' getTok n
braced :: PandocMonad m => LP m [Tok]
-braced = bgroup *> braced' anyTok 1
+braced = symbol '{' *> braced' anyTok 1
-- URLs require special handling, because they can contain %
-- characters. So we retonenize comments as we go...