RST reader: fix treatment of headerless simple tables.

We were producing a header with blank cells rather than no
header.  Closes #7902.
This commit is contained in:
John MacFarlane 2022-02-11 09:42:24 -08:00
parent e8c1c6adb1
commit 899feec4d3
3 changed files with 3 additions and 20 deletions

View file

@ -1304,7 +1304,7 @@ simpleTableHeader headless = try $ do
let indices = scanl (+) 0 lines'
let aligns = replicate (length lines') AlignDefault
let rawHeads = if headless
then replicate (length dashes) ""
then []
else simpleTableSplitLine indices rawContent
heads <- mapM ( parseFromString' (mconcat <$> many plain) . trim) rawHeads
return (heads, aligns, indices)

View file

@ -1124,15 +1124,7 @@ Pandoc
, ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead
( "" , [] , [] )
[ Row
( "" , [] , [] )
[ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
, Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
, Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
]
])
(TableHead ( "" , [] , [] ) [])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)

View file

@ -755,16 +755,7 @@
, ( AlignDefault , ColWidthDefault )
, ( AlignDefault , ColWidthDefault )
]
(TableHead
( "" , [] , [] )
[ Row
( "" , [] , [] )
[ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
, Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
, Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
, Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
]
])
(TableHead ( "" , [] , [] ) [])
[ TableBody
( "" , [] , [] )
(RowHeadColumns 0)