From fba50901e45483a339a16334b628271f770baddf Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 14 Nov 2016 21:02:47 +0000 Subject: Use separator during simplification --- lib/html/simplify.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/html/simplify.js') diff --git a/lib/html/simplify.js b/lib/html/simplify.js index 081c3f8..e05bde2 100644 --- a/lib/html/simplify.js +++ b/lib/html/simplify.js @@ -37,6 +37,9 @@ function identity(value) { function appendChild(children, child) { var lastChild = children[children.length - 1]; if (child.type === "element" && !child.tag.fresh && lastChild && lastChild.type === "element" && child.tag.matchesElement(lastChild.tag)) { + if (child.tag.separator) { + appendChild(lastChild.children, ast.text(child.tag.separator)); + } child.children.forEach(function(grandChild) { // Mutation is fine since simplifying elements create a copy of the children. appendChild(lastChild.children, grandChild); -- cgit v1.2.3