aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-05-29 22:45:49 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-29 22:47:04 +0200
commit5ec384eb60a4d32a83e94eec041020004dff96ce (patch)
treeddea05cf7f12072e2d22f5691f08df488b33f298 /src/Text
parent230a1b89e8fd761a67599aad190a6b9462686abc (diff)
downloadpandoc-5ec384eb60a4d32a83e94eec041020004dff96ce.tar.gz
LaTeX reader: handle escaped & inside table cell.
Closes #3708.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs8
1 files changed, 5 insertions, 3 deletions
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)