Изменения

Do not merge block tags
Строка 67: Строка 67:  
}
 
}
   −
-- Table amd list tags are unmergeable:
+
-- Block tags are block:
local unmergeable = to_set {
+
local block = to_set {
 +
'p', 'div',
 
'table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td',
 
'table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td',
 
'ol', 'ul', 'li', 'dl', 'dt', 'dd'
 
'ol', 'ul', 'li', 'dl', 'dt', 'dd'
Строка 78: Строка 79:  
return false
 
return false
 
end
 
end
if unmergeable [node1.__name] or unmergeable [node2.__name] then
+
if block [node1.__name] or block [node2.__name] then
 
-- Table elements should not be merged:
 
-- Table elements should not be merged:
 
return false
 
return false
Строка 106: Строка 107:  
return merged
 
return merged
 
end
 
end
-- Unmergeable:
+
-- block:
 
return node1, node2
 
return node1, node2
 
end
 
end
Строка 147: Строка 148:  
end
 
end
 
local child = node [1]
 
local child = node [1]
if not child or type (child) == 'string' or unmergeable [child.__name] then
+
if not child or type (child) == 'string' or block [child.__name] then
 
return node
 
return node
 
end
 
end