diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-08-11 10:32:52 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-08-11 10:32:52 -0700 |
commit | a0e44b1ff651ba59fe23b9e1b5d534d324dc0808 (patch) | |
tree | b7847ac514fcacc088e1d7a0f3097436e5b93374 /src/Text/Pandoc/Readers/LaTeX/Parsing.hs | |
parent | 06d97131e530d2ee9b14617290a157dd42c0db30 (diff) | |
download | pandoc-a0e44b1ff651ba59fe23b9e1b5d534d324dc0808.tar.gz |
LaTeX reader: improve handling of plain TeX macro primitives.
- Fixed semantics for `\let`.
- Implement `\edef`, `\gdef`, and `\xdef`.
- Add comment noting that currently `\def` and `\edef` set global
macros (so are equivalent to `\gdef` and `\xdef`). This should be
fixed by scoping macro definitions to groups, in a future commit.
Closes #7474.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX/Parsing.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 9dac4d6ef..8d6791abb 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -267,7 +267,7 @@ rawLaTeXParser toks retokenize parser valParser = do Right (endpos, toks') -> do res <- lift $ runParserT (do when retokenize $ do -- retokenize, applying macros - ts <- many (satisfyTok (const True)) + ts <- many anyTok setInput ts rawparser) lstate' "chunk" toks' @@ -296,7 +296,7 @@ rawLaTeXParser toks retokenize parser valParser = do applyMacros :: (PandocMonad m, HasMacros s, HasReaderOptions s) => Text -> ParserT Sources s m Text applyMacros s = (guardDisabled Ext_latex_macros >> return s) <|> - do let retokenize = untokenize <$> many (satisfyTok (const True)) + do let retokenize = untokenize <$> many anyTok pstate <- getState let lstate = def{ sOptions = extractReaderOptions pstate , sMacros = extractMacros pstate } |