Skip to content

Commit aeb413e

Browse files
committed
add test for individual text node
1 parent eadaed1 commit aeb413e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/parse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@ test('parse', function (t) {
303303
children: []
304304
}], 'should not explode on trailing whitespace');
305305

306+
html = ' Hi There ';
307+
parsed = HTML.parse(html);
308+
t.deepEqual(parsed, [{
309+
type: 'text', content: ' Hi There '
310+
}], 'should handle text nodes at the top-level');
311+
306312
html = '<div>Hi</div> There ';
307313
parsed = HTML.parse(html);
308314
t.deepEqual(parsed, [{

0 commit comments

Comments
 (0)