@@ -1255,10 +1255,14 @@ parseTableRow :: Int -- ^ number of columns
12551255parseTableRow cols = try $ do
12561256 let tableCellInline = notFollowedBy (amp <|> lbreak) >> inline
12571257 let tableCell = (plain . trimInlines . mconcat) <$> many tableCellInline
1258− cells' <- sepBy tableCell amp
1259− guard $ length cells' == cols
1258+ cells' <- sepBy1 tableCell amp
1259+ let numcells = length cells'
1260+ guard $ numcells <= cols && numcells >= 1
1261+ guard $ cells' /= [mempty]
1262+ -- note: a & b in a three-column table leaves an empty 3rd cell:
1263+ let cells'' = cells' ++ replicate (cols - numcells) mempty
12601264 spaces
1261− return cells'
1265+ return cells''
12621266
12631267simpTable :: LP Blocks
12641268simpTable = try $ do