summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-02-23 22:03:29 +0000
committerKarl Berry <karl@freefriends.org>2024-02-23 22:03:29 +0000
commit47bb9f122602978d89bc9df8aee134653fe1e4ec (patch)
tree06cbf3aa174e09118987d85044acc0696455cfab /Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua
parent9e0b0b9845e5100ceb20fe50885ca0af77e2896c (diff)
make4ht (23feb24)
git-svn-id: svn://tug.org/texlive/trunk@70097 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua')
-rw-r--r--Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua b/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua
index ef36a85750a..11dbfcaa711 100644
--- a/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua
+++ b/Master/texmf-dist/scripts/make4ht/domfilters/make4ht-tablerows.lua
@@ -4,11 +4,17 @@ return function(dom)
-- detect if the element contains child elements
local child_elements = 0
local children = child:get_children()
- for _, el in ipairs(children) do
+ local last_child_pos
+ for pos, el in ipairs(children) do
+ last_child_pos = pos
local step = el:is_element() and 1 or 0
-- log:info("element name", el._name)
child_elements = child_elements + step
end
+ -- longtable has <td><p></p></td> inside empty rows, we regard them as empty
+ if child_elements == 1 and children[last_child_pos]:get_element_name() == "p" and child:get_text():gsub("%s", "") == "" then
+ child_elements = 0
+ end
return child_elements > 0
end
local is_empty_row = function(row)