From 5ec384eb60a4d32a83e94eec041020004dff96ce Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 29 May 2017 22:45:49 +0200 Subject: LaTeX reader: handle escaped & inside table cell. Closes #3708. --- src/Text/Pandoc/Readers/LaTeX.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 4179f4550..d1262867c 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1494,9 +1494,11 @@ parseTableRow :: PandocMonad m -> [String] -- ^ suffixes -> LP m [Blocks] parseTableRow cols prefixes suffixes = try $ do - let tableCellRaw = many (notFollowedBy - (amp <|> lbreak <|> - (() <$ try (string "\\end"))) >> anyChar) + let tableCellRaw = concat <$> many + (do notFollowedBy (amp <|> lbreak <|> (() <$ try (string "\\end"))) + many1 (noneOf "&%\n\r\\") + <|> try (string "\\&") + <|> count 1 anyChar) let minipage = try $ controlSeq "begin" *> string "{minipage}" *> env "minipage" (skipopts *> spaces' *> optional braced *> spaces' *> blocks) -- cgit v1.2.3