diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-09-02 18:48:37 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-02 18:48:37 -0700 |
commit | 5e708eb8ce4bb4325b009ac37a5986517d6b9290 (patch) | |
tree | c5a67838048f670463f86bee2e8826352b9057db /src/Text/Pandoc | |
parent | 3fac27b26b825a36304169c698e422801605de2c (diff) | |
download | pandoc-5e708eb8ce4bb4325b009ac37a5986517d6b9290.tar.gz |
LaTeX reader: properly handle optional arguments for macros.
Closes #5682.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 4e006fa8a..76a48a364 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1591,7 +1591,7 @@ newcommand = do (symbol '{' *> spaces *> anyControlSeq <* spaces <* symbol '}') spaces numargs <- option 0 $ try bracketedNum - let argspecs = map (\i -> ArgNum i) [1..numargs] + let argspecs = map ArgNum [1..numargs] spaces optarg <- option Nothing $ Just <$> try bracketedToks spaces diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index b9114d34c..547b855e2 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -448,7 +448,7 @@ doMacros' n inp = do Nothing -> getargs M.empty argspecs Just o -> do x <- option o bracketedToks - getargs (M.singleton 1 x) argspecs + getargs (M.singleton 1 x) $ drop 1 argspecs rest <- getInput return (args, rest) lstate <- getState |