diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:14:11 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-10-14 19:14:11 +0100 |
| commit | 46ad965f936563829a7c0549a5eb1af89155ee48 (patch) | |
| tree | 3cb9ab57466bc375926c1d04fce9a6f4f4e8858b /lib/html/ast.js | |
| parent | 27895603885e677e0ae6677553c8636b4af51cb3 (diff) | |
Add extra tests for simplification of empty elements
Diffstat (limited to 'lib/html/ast.js')
| -rw-r--r-- | lib/html/ast.js | 7 |
1 files changed, 7 insertions, 0 deletions
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; |
