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
commit55bcd4b4fb1dced6c6e316db6cd117b52bbadee5
authorAlbert Krewinkel <albert@zeitkraut.de>
dateThu 10 Jun 2021, 18:26 (5 years ago)
parent76e5f04
src/Text/Pandoc/Lua/Module/Utils.hs+1−1
@@ -146,7 +146,7 @@ from_simple_table (SimpleTable capt aligns widths head' body) = do
146146 nullAttr
147147 (Caption Nothing [Plain capt])
148148 (zipWith (\a w -> (a, toColWidth w)) aligns widths)
149− (TableHead nullAttr [blockListToRow head'])
149+ (TableHead nullAttr [blockListToRow head' | not (null head') ])
150150 [TableBody nullAttr 0 [] $ map blockListToRow body]
151151 (TableFoot nullAttr [])
152152 return (NumResults 1)