From 9a4097640f052468054105cde8ef342ac8a1db30 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Nov 2020 13:39:00 -0800 Subject: Improve LaTeX option parsing... in cases where we run into trouble parsing inlines til the closing `]`, e.g. quotes, we return a plain string with the option contents. Previously we mistakenly included the brackets in this string. Closes #6869. --- src/Text/Pandoc/Readers/LaTeX.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 61c9abe3a..2ec191154 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -559,7 +559,9 @@ tok = try $ spaces >> grouped inline <|> inlineCommand' <|> singleChar' return $ str t opt :: PandocMonad m => LP m Inlines -opt = bracketed inline <|> (str <$> rawopt) +opt = bracketed inline + <|> + (str . T.dropWhile (=='[') . T.dropWhileEnd (==']') <$> rawopt) paropt :: PandocMonad m => LP m Inlines paropt = parenWrapped inline -- cgit v1.2.3