Lua utils: fix handling of table headers in from_simple_table

Passing an empty list of header cells now results in an empty table
header.

Fixes: #7369
This commit is contained in:
Albert Krewinkel 2021-06-10 18:26:53 +02:00
parent 76e5f047b0
commit 55bcd4b4fb
No known key found for this signature in database
GPG key ID: 388DC0B21F631124

View file

@ -146,7 +146,7 @@ from_simple_table (SimpleTable capt aligns widths head' body) = do
nullAttr
(Caption Nothing [Plain capt])
(zipWith (\a w -> (a, toColWidth w)) aligns widths)
(TableHead nullAttr [blockListToRow head'])
(TableHead nullAttr [blockListToRow head' | not (null head') ])
[TableBody nullAttr 0 [] $ map blockListToRow body]
(TableFoot nullAttr [])
return (NumResults 1)