aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-20 13:42:43 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-20 13:42:43 -0700
commitf2fdd275fd44b4992d5ae3736c3f28deec700ba8 (patch)
tree44aed826789219f3d51beb4afc5471f61ce1c966 /src/Text/Pandoc
parente334d7dc389203b48b8e5f0d90960d08350b93f8 (diff)
downloadpandoc-f2fdd275fd44b4992d5ae3736c3f28deec700ba8.tar.gz
LaTeX reader: allow `]` inside group in option brackets.
Closes #3857.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 9699fc742..56eb85064 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1120,8 +1120,7 @@ opt = bracketed inline
rawopt :: PandocMonad m => LP m Text
rawopt = do
- symbol '['
- inner <- untokenize <$> manyTill anyTok (symbol ']')
+ inner <- untokenize <$> bracketedToks
optional sp
return $ "[" <> inner <> "]"
@@ -1789,7 +1788,7 @@ newenvironment = do
bracketedToks :: PandocMonad m => LP m [Tok]
bracketedToks = do
symbol '['
- manyTill anyTok (symbol ']')
+ mconcat <$> manyTill (braced <|> (:[]) <$> anyTok) (symbol ']')
bracketedNum :: PandocMonad m => LP m Int
bracketedNum = do