From 78675243051d4109aee41e931e17a0d723719bd8 Mon Sep 17 00:00:00 2001 From: tmont Date: Wed, 6 Jun 2012 14:31:38 -0700 Subject: [PATCH] < or is still a tag', function() { + it('< followed by whitespace is not a tag', function() { var openCount = 0, textCount = 0; - helpers.parseString('< foo', { + helpers.parseString('< foo>', { openElement: function(name) { - name.should.equal('foo'); openCount++; }, text: function(value) { + value.should.equal('< foo>'); textCount++; } }); - openCount.should.equal(1); - textCount.should.equal(0); + openCount.should.equal(0); + textCount.should.equal(1); }); it('< followed by ! but not cdata or comment should be a text node', function() { @@ -63,13 +63,13 @@ describe('Malformed HTML', function() { it('', { closeElement: function(name) { closeCount++; }, text: function(value) { - value.should.equal(''); textCount++; } }); diff --git a/tests/open-and-close-tag-tests.js b/tests/open-and-close-tag-tests.js index 058350b..41e1127 100644 --- a/tests/open-and-close-tag-tests.js +++ b/tests/open-and-close-tag-tests.js @@ -67,7 +67,7 @@ describe('opening and closing tags', function() { it('tag names with weird whitespace', function() { var openCount = 0, closeCount = 0; - helpers.parseString('< \n foo\n>', { + helpers.parseString('', { openElement: function(name) { name.should.equal('foo'); openCount++;