aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-09-19 10:11:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-09-19 10:12:07 -0700
commitc9ce6da1bb69edd5d81952e164fb32c3a0a8f344 (patch)
tree91f248a7c0c8b6fc1aec6551f3f43113fa7da019 /src/Text/Pandoc/Readers/LaTeX/Parsing.hs
parent132a6df51e52463178711a648e848f6f73299dc8 (diff)
downloadpandoc-c9ce6da1bb69edd5d81952e164fb32c3a0a8f344.tar.gz
LaTeX reader: Recognize that `\vadjust` sometimes takes "pre".
Closes #7531.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX/Parsing.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Parsing.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
index 9b84cdd21..7366d7b2d 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -941,6 +941,9 @@ getRawCommand name txt = do
void $ count 4 braced
"def" ->
void $ manyTill anyTok braced
+ "vadjust" ->
+ void (manyTill anyTok braced) <|>
+ void (satisfyTok isPreTok) -- see #7531
_ | isFontSizeCommand name -> return ()
| otherwise -> do
skipopts
@@ -948,6 +951,10 @@ getRawCommand name txt = do
void $ many braced
return $ txt <> untokenize rawargs
+isPreTok :: Tok -> Bool
+isPreTok (Tok _ Word "pre") = True
+isPreTok _ = False
+
isDigitTok :: Tok -> Bool
isDigitTok (Tok _ Word t) = T.all isDigit t
isDigitTok _ = False