Socket
Socket
Sign inDemoInstall

htmlparser2

Package Overview
Dependencies
13
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.9.0 to 3.9.1

8

lib/FeedHandler.js
var index = require("./index.js"),
DomHandler = index.DomHandler,
DomUtils = index.DomUtils;
DomUtils = index.DomUtils;

@@ -10,3 +10,3 @@ //TODO: make this a streamable handler

require("util").inherits(FeedHandler, DomHandler);
require("inherits")(FeedHandler, DomHandler);

@@ -38,4 +38,4 @@ FeedHandler.prototype.init = DomHandler;

var feed = {},
feedRoot = getOneElement(isValidFeed, this.dom),
tmp, childs;
feedRoot = getOneElement(isValidFeed, this.dom),
tmp, childs;

@@ -42,0 +42,0 @@ if(feedRoot){

@@ -114,3 +114,4 @@ var Tokenizer = require("./Tokenizer.js");

!this._options.xmlMode;
if(!!this._options.Tokenizer) {
if(this._options.Tokenizer) {
Tokenizer = this._options.Tokenizer;

@@ -123,3 +124,3 @@ }

require("util").inherits(Parser, require("events").EventEmitter);
require("inherits")(Parser, require("events").EventEmitter);

@@ -126,0 +127,0 @@ Parser.prototype._updatePosition = function(initialOffset){

@@ -9,3 +9,3 @@ module.exports = Stream;

require("util").inherits(Stream, Parser);
require("inherits")(Stream, Parser);

@@ -12,0 +12,0 @@ Stream.prototype.readable = true;

@@ -169,2 +169,5 @@ module.exports = Tokenizer;

this._state = BEFORE_CLOSING_TAG_NAME;
} else if(c === "<"){
this._cbs.ontext(this._getSection());
this._sectionStart = this._index;
} else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {

@@ -178,5 +181,2 @@ this._state = TEXT;

this._sectionStart = this._index + 1;
} else if(c === "<"){
this._cbs.ontext(this._getSection());
this._sectionStart = this._index;
} else {

@@ -611,9 +611,9 @@ this._state = (!this._xmlMode && (c === "s" || c === "S")) ?

this._buffer = "";
this._bufferOffset += this._index;
this._index = 0;
this._bufferOffset += this._index;
} else if(this._sectionStart === this._index){
//the section just started
this._buffer = "";
this._bufferOffset += this._index;
this._index = 0;
this._bufferOffset += this._index;
} else {

@@ -620,0 +620,0 @@ //remove everything unnecessary

module.exports = Stream;
var Parser = require("./Parser.js"),
WritableStream = require("stream").Writable || require("readable-stream").Writable;
WritableStream = require("stream").Writable || require("readable-stream").Writable,
StringDecoder = require("string_decoder").StringDecoder,
Buffer = require("buffer").Buffer;
function Stream(cbs, options){
var parser = this._parser = new Parser(cbs, options);
var decoder = this._decoder = new StringDecoder();

@@ -12,11 +15,12 @@ WritableStream.call(this, {decodeStrings: false});

this.once("finish", function(){
parser.end();
parser.end(decoder.end());
});
}
require("util").inherits(Stream, WritableStream);
require("inherits")(Stream, WritableStream);
WritableStream.prototype._write = function(chunk, encoding, cb){
if(chunk instanceof Buffer) chunk = this._decoder.write(chunk);
this._parser.write(chunk);
cb();
};
{
"name": "htmlparser2",
"description": "Fast & forgiving HTML/XML/RSS parser",
"version": "3.9.0",
"version": "3.9.1",
"author": "Felix Boehm <me@feedic.com>",

@@ -35,3 +35,3 @@ "keywords": [

"test": "mocha && npm run lint",
"lint": "jshint lib test && jscs lib test"
"lint": "eslint lib test"
},

@@ -43,2 +43,3 @@ "dependencies": {

"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^2.0.2"

@@ -48,7 +49,6 @@ },

"coveralls": "^2.11.4",
"istanbul": "^0.3.18",
"jscs": "^2.1.0",
"jshint": "^2.8.0",
"istanbul": "^0.4.3",
"mocha": "^2.2.5",
"mocha-lcov-reporter": "^0.0.2"
"eslint": "^2.12.0",
"mocha-lcov-reporter": "^1.2.0"
},

@@ -58,22 +58,3 @@ "browser": {

},
"license": "MIT",
"jshintConfig": {
"eqeqeq": true,
"freeze": true,
"latedef": "nofunc",
"noarg": true,
"nonbsp": true,
"quotmark": "double",
"undef": true,
"unused": true,
"trailing": true,
"eqnull": true,
"proto": true,
"smarttabs": true,
"node": true,
"globals": {
"describe": true,
"it": true
}
}
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc