local log = logging.new ("tablerows") return function(dom) local is_empty_row = function(row) local not_empty = false local element_count = 0 -- ignore hline rows local row_class = row:get_attribute("class") if row_class == "hline" or row_class == "cline" then return false end -- detect if the row contain only one empty child for _,child in ipairs(row:get_children() or {}) do if child:is_element() then element_count = element_count + 1 -- empty rows contain only one element, it is not empty otherwise if element_count > 1 then return false end -- detect if it contains only whitespace not_empty = child:get_text():gsub("%s","") ~= "" or not_empty end end -- print("element count", element_count, not_empty) return element_count == 1 and not_empty == false end local is_not_styled = function(row, css) -- get the id attribute and escape it, so it can be used in regexp local id = row:get_attribute("id") if not id then return true end -- no styling without id local search_term = "%#" .. id:gsub("%-", "%%-") -- if the CSS file contains the row id (