aboutsummaryrefslogtreecommitdiff
path: root/lib/html/simplify.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/html/simplify.js')
-rw-r--r--lib/html/simplify.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/html/simplify.js b/lib/html/simplify.js
index e05bde2..8ba37eb 100644
--- a/lib/html/simplify.js
+++ b/lib/html/simplify.js
@@ -21,7 +21,6 @@ function collapseNode(node) {
var collapsers = {
element: collapseElement,
- selfClosingElement: identity,
text: identity,
forceWrite: identity
};
@@ -61,7 +60,6 @@ function flatMap(values, func) {
var emptiers = {
element: elementEmptier,
- selfClosingElement: neverEmpty,
text: textEmptier,
forceWrite: neverEmpty
};
@@ -72,10 +70,10 @@ function neverEmpty(node) {
function elementEmptier(element) {
var children = removeEmpty(element.children);
- if (children.length === 0) {
+ if (children.length === 0 && !ast.isVoidElement(element)) {
return [];
} else {
- return ast.elementWithTag(element.tag, children);
+ return [ast.elementWithTag(element.tag, children)];
}
}