LaTeX reader: handle tabular* environment.

This change allows pandoc not to choke on the table-width parameter
of `tabular*`.  Note that the table width is not actually parsed
or taken into account, but this should give tolerable results in
many cases.

Closes #1850.
This commit is contained in:
John MacFarlane
2015-01-01 08:46:45 -08:00
parent 52310eb470
commit e7187fa3bb
+5 -3
View File
@@ -1018,7 +1018,8 @@ environments = M.fromList
, ("center", env "center" blocks)
, ("table", env "table" $
resetCaption *> skipopts *> blocks >>= addTableCaption)
, ("tabular", env "tabular" simpTable)
, ("tabular*", env "tabular" $ simpTable True)
, ("tabular", env "tabular" $ simpTable False)
, ("quote", blockQuote <$> env "quote" blocks)
, ("quotation", blockQuote <$> env "quotation" blocks)
, ("verse", blockQuote <$> env "verse" blocks)
@@ -1304,8 +1305,9 @@ parseTableRow cols = try $ do
spaces
return cells''
simpTable :: LP Blocks
simpTable = try $ do
simpTable :: Bool -> LP Blocks
simpTable hasWidthParameter = try $ do
when hasWidthParameter $ () <$ (spaces >> tok)
spaces
aligns <- parseAligns
let cols = length aligns