Comparing version 1.0.7 to 1.0.8
@@ -89,3 +89,5 @@ /* jshint node:true */ | ||
if(nextTagFullClose > nextTagSelfClose) { | ||
if(nextTagFullClose > -1 && | ||
(Math.max(0, nextTagFullClose - fullClose.length) < Math.max(0, nextTagSelfClose - selfClose.length)) || | ||
nextTagSelfClose === -1) { | ||
tags.push(reducedHtml.substr(0, nextTagFullClose + fullClose.length)); | ||
@@ -92,0 +94,0 @@ reducedHtml = reducedHtml.substr(nextTagFullClose + fullClose.length); |
{ | ||
"name": "nodesi", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "ESI: the good parts in node.js", | ||
@@ -5,0 +5,0 @@ "main": "esi.js", |
@@ -119,2 +119,23 @@ /* jshint node:true */ | ||
it('should handle self-closing tags in html', function (done) { | ||
// given | ||
server.addListener('request', function (req, res) { | ||
res.writeHead(200, {'Content-Type': 'text/html'}); | ||
res.end('<div>test</div>'); | ||
}); | ||
var html = '<section><esi:include src="http://localhost:' + port + '"></esi:include><img src="some-image" /></section>'; | ||
// when | ||
var processed = new ESI().process(html); | ||
// then | ||
processed.then(function (response) { | ||
assert.equal(response, '<section><div>test</div><img src="some-image" /></section>'); | ||
done(); | ||
}).catch(done); | ||
}); | ||
it('should fetch one relative component', function (done) { | ||
@@ -121,0 +142,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
963267
958