@@ -1088,7 +1088,7 @@ environments = M.fromList
1088 resetCaption *> skipopts *> blocks >>= addImageCaption)
1088 resetCaption *> skipopts *> blocks >>= addImageCaption)
1089 , ("center", env "center" blocks)
1089 , ("center", env "center" blocks)
1090 , ("longtable", env "longtable" $
1090 , ("longtable", env "longtable" $
1091− resetCaption *> skipopts *> blocks >>= addTableCaption)
1091+ resetCaption *> simpTable False >>= addTableCaption)
1092 , ("table", env "table" $
1092 , ("table", env "table" $
1093 resetCaption *> skipopts *> blocks >>= addTableCaption)
1093 resetCaption *> skipopts *> blocks >>= addTableCaption)
1094 , ("tabular*", env "tabular" $ simpTable True)
1094 , ("tabular*", env "tabular" $ simpTable True)
@@ -1374,7 +1374,9 @@ hline = try $ do
1374 return ()
1374 return ()
1376lbreak :: LP ()
1376lbreak :: LP ()
1377−lbreak = () <$ try (spaces' *> controlSeq "\\" <* spaces')
1377+lbreak = () <$ try (spaces' *>
1378+ (controlSeq "\\" <|> controlSeq "tabularnewline") <*
1379amp :: LP ()
1381amp :: LP ()
1380amp = () <$ try (spaces' *> char '&')
1382amp = () <$ try (spaces' *> char '&')
@@ -1402,9 +1404,15 @@ simpTable hasWidthParameter = try $ do
1402 skipopts
1404 skipopts
1403 aligns <- parseAligns
1405 aligns <- parseAligns
1404 let cols = length aligns
1406 let cols = length aligns
1405− optional hline
1407+ optional $ controlSeq "caption" *> skipopts *> setCaption
1406− header' <- option [] $ try (parseTableRow cols <* lbreak <* hline)
1411+ header' <- option [] $ try (parseTableRow cols <* lbreak <* many1 hline)
1407− rows <- sepEndBy (parseTableRow cols) (lbreak <* optional hline)
1412+ rows <- sepEndBy (parseTableRow cols) (lbreak <* optional (skipMany hline))
1414+ optional $ controlSeq "caption" *> skipopts *> setCaption
1409 let header'' = if null header'
1417 let header'' = if null header'
1410 then replicate cols mempty
1418 then replicate cols mempty