From 46ad965f936563829a7c0549a5eb1af89155ee48 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 14 Oct 2015 19:14:11 +0100 Subject: Add extra tests for simplification of empty elements --- lib/html/ast.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/html/ast.js') diff --git a/lib/html/ast.js b/lib/html/ast.js index 96aa6c6..6056f5c 100644 --- a/lib/html/ast.js +++ b/lib/html/ast.js @@ -10,6 +10,12 @@ function fragment(children) { }; } +function nonFreshElement(tagName, attributes, children) { + return elementWithTag( + htmlPaths.element(tagName, attributes, {fresh: false}), + children); +} + function element(tagName, attributes, children) { return elementWithTag( htmlPaths.element(tagName, attributes, {fresh: true}), @@ -62,6 +68,7 @@ function collapseFragments(elements) { exports.fragment = fragment; exports.element = element; +exports.nonFreshElement = nonFreshElement; exports.elementWithTag = elementWithTag; exports.selfClosingElement = selfClosingElement; exports.text = text; -- cgit v1.2.3