From c9ce6da1bb69edd5d81952e164fb32c3a0a8f344 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 10:11:29 -0700 Subject: LaTeX reader: Recognize that `\vadjust` sometimes takes "pre". Closes #7531. --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Text/Pandoc/Readers/LaTeX') 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 -- cgit v1.2.3