@@ -93,8 +93,6 @@ import Text.Pandoc.Readers.LaTeX.Types (ExpansionPoint (..), Macro (..),
9393import Text.Pandoc.Shared
9494import Text.Parsec.Pos
9595
96−-- import Debug.Trace (traceShowId)
97−
9896newtype DottedNum = DottedNum [Int]
9997 deriving (Show)
10098
@@ -447,7 +445,7 @@ doMacros' n inp = do
447445 args <- case optarg of
448446 Nothing -> getargs M.empty argspecs
449447 Just o -> do
450− x <- option o bracketedToks
448+ x <- option o $ bracketedToks
451449 getargs (M.singleton 1 x) $ drop 1 argspecs
452450 rest <- getInput
453451 return (args, rest)
@@ -644,7 +642,8 @@ bracketed parser = try $ do
644642bracketedToks :: PandocMonad m => LP m [Tok]
645643bracketedToks = do
646644 symbol '['
647− mconcat <$> manyTill (braced <|> (:[]) <$> anyTok) (symbol ']')
645+ concat <$> manyTill ((snd <$> withRaw (try braced)) <|> count 1 anyTok)
646+ (symbol ']')
648647
649648parenWrapped :: PandocMonad m => Monoid a => LP m a -> LP m a
650649parenWrapped parser = try $ do