LaTeX reader: improve parsing of \def
argspec.
This commit is contained in:
parent
e752a027f1
commit
78ebbc6eef
1 changed files with 4 additions and 4 deletions
|
@ -1524,14 +1524,14 @@ defmacro = try $ do
|
||||||
|
|
||||||
argspecArg :: PandocMonad m => LP m ArgSpec
|
argspecArg :: PandocMonad m => LP m ArgSpec
|
||||||
argspecArg = do
|
argspecArg = do
|
||||||
Tok _ (Arg i) _ <- satisfyTok isArgTok
|
Tok _ (Arg i) _ <- withVerbatimMode $ satisfyTok isArgTok
|
||||||
return $ ArgNum i
|
return $ ArgNum i
|
||||||
|
|
||||||
argspecPattern :: PandocMonad m => LP m ArgSpec
|
argspecPattern :: PandocMonad m => LP m ArgSpec
|
||||||
argspecPattern =
|
argspecPattern = withVerbatimMode $
|
||||||
Pattern <$> many1 (satisfyTok (\(Tok _ toktype' txt) ->
|
Pattern <$> many1 (satisfyTok (\(Tok _ toktype' txt) ->
|
||||||
(toktype' == Symbol || toktype' == Word) &&
|
(toktype' == Symbol || toktype' == Word) &&
|
||||||
(txt /= "{" && txt /= "\\" && txt /= "}")))
|
(txt /= "{" && txt /= "\\" && txt /= "}")))
|
||||||
|
|
||||||
newcommand :: PandocMonad m => LP m (Text, Macro)
|
newcommand :: PandocMonad m => LP m (Text, Macro)
|
||||||
newcommand = do
|
newcommand = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue