Markdown reader: fix pipe table regression in 2.11.4.

Previously pipe tables with empty headers (that is, a header
line with all empty cells) would be rendered as headerless
tables.  This broke in 2.11.4.

The fix here is to produce an AST with an empty table head
when a pipe table has all empty header cells.

Closes #7343.
This commit is contained in:
John MacFarlane 2021-06-01 21:44:55 -06:00
parent abb59bd582
commit 2e4ef14d91
2 changed files with 3 additions and 11 deletions

View file

@ -2254,4 +2254,4 @@ toRow :: [Blocks] -> Row
toRow = Row nullAttr . map B.simpleCell
toHeaderRow :: [Blocks] -> [Row]
toHeaderRow l = [toRow l | not (null l)]
toHeaderRow l = [toRow l | not (null l) && not (all null l)]

View file

@ -131,13 +131,7 @@
,(AlignLeft,ColWidthDefault)
,(AlignCenter,ColWidthDefault)]
(TableHead ("",[],[])
[Row ("",[],[])
[Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
[]
,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
[]
,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
[]]])
[])
[(TableBody ("",[],[]) (RowHeadColumns 0)
[]
[Row ("",[],[])
@ -213,9 +207,7 @@
[])
[(AlignCenter,ColWidthDefault)]
(TableHead ("",[],[])
[Row ("",[],[])
[Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
[]]])
[])
[(TableBody ("",[],[]) (RowHeadColumns 0)
[]
[Row ("",[],[])