aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-12-25 20:47:29 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-12-25 21:20:18 +0100
commitfbd2c8e376eea5eccc0b799f8e48d10c7ab8b6d9 (patch)
tree448a170d242018acc73e765dd18cd11f26df8b4d /src
parente54f6dcd7a6367d6d6408a4a5151b703aef3c533 (diff)
downloadpandoc-fbd2c8e376eea5eccc0b799f8e48d10c7ab8b6d9.tar.gz
Lua: improve handling of empty caption, body by `from_simple_table`
Create truly empty table caption and body when these are empty in the simple table. Fixes: #7776
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Lua/Module/Utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs
index eabb2b532..02307cf7a 100644
--- a/src/Text/Pandoc/Lua/Module/Utils.hs
+++ b/src/Text/Pandoc/Lua/Module/Utils.hs
@@ -197,10 +197,10 @@ from_simple_table :: SimpleTable -> LuaE PandocError NumResults
from_simple_table (SimpleTable capt aligns widths head' body) = do
Lua.push $ Table
nullAttr
- (Caption Nothing [Plain capt])
+ (Caption Nothing [Plain capt | not (null capt)])
(zipWith (\a w -> (a, toColWidth w)) aligns widths)
(TableHead nullAttr [blockListToRow head' | not (null head') ])
- [TableBody nullAttr 0 [] $ map blockListToRow body]
+ [TableBody nullAttr 0 [] $ map blockListToRow body | not (null body)]
(TableFoot nullAttr [])
return (NumResults 1)
where