blob: f4e84b55d961c09ded28ac04bea4977a83fc497a (
plain)
1
2
3
4
5
6
7
8
9
|
-- find all tables inside paragraphs, replace the found paragraphs with the child table
return function(dom)
for _,table in ipairs(dom:query_selector("text|p table|table")) do
-- replace the paragraph by its child element
local parent = table:get_parent()
parent:replace_node(table)
end
return dom
end
|