git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: improve parsing of `\def` argspec.
78ebbc6John MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+4−4
@@ -1524,14 +1524,14 @@ defmacro = try $ do
1524
1524
1525argspecArg :: PandocMonad m => LP m ArgSpec
1525argspecArg :: PandocMonad m => LP m ArgSpec
1526argspecArg = do
1526argspecArg = do
1527− Tok _ (Arg i) _ <- satisfyTok isArgTok
1527+ Tok _ (Arg i) _ <- withVerbatimMode $ satisfyTok isArgTok
1528 return $ ArgNum i
1528 return $ ArgNum i
1529
1529
1530argspecPattern :: PandocMonad m => LP m ArgSpec
1530argspecPattern :: PandocMonad m => LP m ArgSpec
1531−argspecPattern =
1531+argspecPattern = withVerbatimMode $
1532 Pattern <$> many1 (satisfyTok (\(Tok _ toktype' txt) ->
1532 Pattern <$> many1 (satisfyTok (\(Tok _ toktype' txt) ->
1533− (toktype' == Symbol || toktype' == Word) &&
1533+ (toktype' == Symbol || toktype' == Word) &&
1534− (txt /= "{" && txt /= "\\" && txt /= "}")))
1534+ (txt /= "{" && txt /= "\\" && txt /= "}")))
1535
1535
1536newcommand :: PandocMonad m => LP m (Text, Macro)
1536newcommand :: PandocMonad m => LP m (Text, Macro)
1537newcommand = do
1537newcommand = do