diff options
author | Simon Schuster <git@rationality.eu> | 2021-08-20 16:41:50 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-08-21 18:08:27 -0700 |
commit | 591cdca38b8af5a50a4e121b34d87f3c9bca5844 (patch) | |
tree | 2ea7fa61adc1ebe2de2eafe9ded80a39e1694787 /src/Text/Pandoc/Readers/LaTeX | |
parent | d05460d00d7c9af3b4913f1760ea385a7d855d84 (diff) | |
download | pandoc-591cdca38b8af5a50a4e121b34d87f3c9bca5844.tar.gz |
LaTeX-parser: restrict \endinput to current file
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 075e1f656..9b84cdd21 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -45,6 +45,7 @@ module Text.Pandoc.Readers.LaTeX.Parsing , isNewlineTok , isWordTok , isArgTok + , infile , spaces , spaces1 , tokTypeIn @@ -646,6 +647,9 @@ isArgTok :: Tok -> Bool isArgTok (Tok _ (Arg _) _) = True isArgTok _ = False +infile :: PandocMonad m => SourceName -> LP m Tok +infile reference = satisfyTok (\(Tok source _ _) -> (sourceName source) == reference) + spaces :: PandocMonad m => LP m () spaces = skipMany (satisfyTok (tokTypeIn [Comment, Spaces, Newline])) |