Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-parser

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-parser - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

2

package.json
{
"name": "html-parser",
"version": "0.6.0",
"version": "0.6.1",
"description": "HTML/XML parser with less explosions",

@@ -5,0 +5,0 @@ "keywords": [ "html", "xml", "parser", "explosion" ],

@@ -75,4 +75,8 @@ var parseContext = require('./context');

context.read(match[0].length);
context.callbacks.cdata(match[1]);
context.callbacks.closeElement(match[2]);
if (match[1]) {
context.callbacks.cdata(match[1]);
}
if (match[2]) {
context.callbacks.closeElement(match[2]);
}
}

@@ -79,0 +83,0 @@

@@ -206,2 +206,43 @@ var should = require('should');

});
it('should not parse cdata or close element if script tag is unclosed', function() {
var closeCount = 0, openCount = 0, cdataCount = 0;
helpers.parseString('<script>', {
openElement: function(name) {
name.should.equal('script');
openCount++;
},
cdata: function(value) {
cdataCount++;
},
closeElement: function(name) {
closeCount++;
}
});
closeCount.should.equal(0);
cdataCount.should.equal(0);
openCount.should.equal(1);
});
it('should not parse cdata if script tag is empty', function() {
var closeCount = 0, openCount = 0, cdataCount = 0;
helpers.parseString('<script></script>', {
openElement: function(name) {
name.should.equal('script');
openCount++;
},
cdata: function(value) {
cdataCount++;
},
closeElement: function(name) {
name.should.equal('script');
closeCount++;
}
});
closeCount.should.equal(1);
cdataCount.should.equal(0);
openCount.should.equal(1);
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc