diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-02-04 11:50:06 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-02-04 11:50:06 -0800 |
commit | ade08f63301a32ca1eee16b2870661341119138d (patch) | |
tree | 2389f5fe01ac3e1f4d0856c752e3fa9b7c02d215 /src/Text/Pandoc/Readers | |
parent | 75485c2f112cdc2e1f95f871d01cc356510166ae (diff) | |
download | pandoc-ade08f63301a32ca1eee16b2870661341119138d.tar.gz |
Small improvements in latex table parser.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 5 |
1 files changed, 2 insertions, 3 deletions
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 |