html-parser
Advanced tools
Comparing version 0.4.0 to 0.5.0
{ | ||
"name": "html-parser", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "HTML/XML parser with less explosions", | ||
@@ -5,0 +5,0 @@ "keywords": [ "html", "xml", "parser", "explosion" ], |
@@ -137,5 +137,5 @@ var parseContext = require('./context'); | ||
if (current == '<') { | ||
buffer += context.readUntilNonWhitespace(); | ||
buffer += context.read(); | ||
if (context.current === '/') { | ||
buffer += context.readUntilNonWhitespace(); | ||
buffer += context.read(); | ||
if (nameRegex.test(context.current)) { | ||
@@ -142,0 +142,0 @@ callbackText(context); |
@@ -22,7 +22,6 @@ var should = require('should'); | ||
it('< followed by a letter without a following > 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++; | ||
@@ -32,2 +31,3 @@ }, | ||
text: function(value) { | ||
value.should.equal('< foo>'); | ||
textCount++; | ||
@@ -37,4 +37,4 @@ } | ||
openCount.should.equal(1); | ||
textCount.should.equal(0); | ||
openCount.should.equal(0); | ||
textCount.should.equal(1); | ||
}); | ||
@@ -69,3 +69,3 @@ | ||
var closeCount = 0, textCount = 0; | ||
helpers.parseString('</5', { | ||
helpers.parseString('</ foo>', { | ||
closeElement: function(name) { | ||
@@ -76,3 +76,3 @@ closeCount++; | ||
text: function(value) { | ||
value.should.equal('</5'); | ||
value.should.equal('</ foo>'); | ||
textCount++; | ||
@@ -79,0 +79,0 @@ } |
@@ -70,3 +70,3 @@ var should = require('should'); | ||
var openCount = 0, closeCount = 0; | ||
helpers.parseString('< \n foo\n></ \n bar >', { | ||
helpers.parseString('<foo\n></bar \n >', { | ||
openElement: function(name) { | ||
@@ -73,0 +73,0 @@ name.should.equal('foo'); |
Sorry, the diff of this file is not supported yet
68516