htmlparser2
Advanced tools
Comparing version 3.9.0 to 3.9.1
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" | ||
} |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5
1354
7
44188
6
10
1
0
+ Addedinherits@^2.0.1