diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-11-30 11:42:19 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-11-30 11:42:19 +0000 |
| commit | c7f99e70cc743702bc27df8efa3a99838e99522a (patch) | |
| tree | 314c33643acffc5effeef027b8c18d30d4ed33d0 | |
| parent | 500e1c20fe77c7ebd561e9f7d8c2b494ebdfced2 (diff) | |
Add test for retention of void elements
| -rw-r--r-- | test/html/simplify.tests.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/html/simplify.tests.js b/test/html/simplify.tests.js index 85d2eb9..d9ab73a 100644 --- a/test/html/simplify.tests.js +++ b/test/html/simplify.tests.js @@ -37,6 +37,13 @@ test("empty children of element are removed", function() { ); }); +test("empty void elements are not removed", function() { + assert.deepEqual( + simplifyNode(nonFreshElement("br", {}, [])), + [nonFreshElement("br", {}, [])] + ); +}); + test("successive fresh elements are not collapsed", function() { var path = htmlPaths.elements([ htmlPaths.element("p", {}, {fresh: true}) |
