From ade08f63301a32ca1eee16b2870661341119138d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Feb 2012 11:50:06 -0800 Subject: Small improvements in latex table parser. --- src/Text/Pandoc/Readers/LaTeX.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 9eb9eb2f9..5cd13fa1d 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -781,11 +781,10 @@ parseTableRow :: Int -- ^ number of columns parseTableRow cols = try $ do let amp = try $ spaces *> string "&" let tableCellInline = notFollowedBy (amp <|> controlSeq "\\") >> inline - cells' <- sepBy (spaces *> ((plain . trimInlines . mconcat) <$> - many tableCellInline)) amp + cells' <- sepBy ((plain . trimInlines . mconcat) <$> many tableCellInline) amp guard $ length cells' == cols spaces - try $ controlSeq "\\" <|> lookAhead (try $ controlSeq "end" >> string "{tabular}") + optional $ controlSeq "\\" return cells' parseTableHeader :: Int -- ^ number of columns -- cgit v1.2.3