node-html-parser
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -480,3 +480,3 @@ import he from 'he'; | ||
hasAttribute(key) { | ||
return key in this.attrs; | ||
return key.toLowerCase() in this.attrs; | ||
} | ||
@@ -499,6 +499,14 @@ /** | ||
} | ||
const k2 = key.toLowerCase(); | ||
const attrs = this.rawAttributes; | ||
for (const k in attrs) { | ||
if (k.toLowerCase() === k2) { | ||
key = k; | ||
break; | ||
} | ||
} | ||
attrs[key] = String(value); | ||
// update this.attrs | ||
if (this._attrs) { | ||
this._attrs[key] = decode(attrs[key]); | ||
this._attrs[k2] = decode(attrs[key]); | ||
} | ||
@@ -505,0 +513,0 @@ // Update rawString |
@@ -1003,3 +1003,3 @@ var __extends = (this && this.__extends) || (function () { | ||
HTMLElement.prototype.hasAttribute = function (key) { | ||
return key in this.attrs; | ||
return key.toLowerCase() in this.attrs; | ||
}; | ||
@@ -1022,6 +1022,14 @@ /** | ||
} | ||
var k2 = key.toLowerCase(); | ||
var attrs = this.rawAttributes; | ||
for (var k in attrs) { | ||
if (k.toLowerCase() === k2) { | ||
key = k; | ||
break; | ||
} | ||
} | ||
attrs[key] = String(value); | ||
// update this.attrs | ||
if (this._attrs) { | ||
this._attrs[key] = decode(attrs[key]); | ||
this._attrs[k2] = decode(attrs[key]); | ||
} | ||
@@ -1028,0 +1036,0 @@ // Update rawString |
@@ -567,3 +567,3 @@ "use strict"; | ||
HTMLElement.prototype.hasAttribute = function (key) { | ||
return key in this.attrs; | ||
return key.toLowerCase() in this.attrs; | ||
}; | ||
@@ -586,6 +586,14 @@ /** | ||
} | ||
var k2 = key.toLowerCase(); | ||
var attrs = this.rawAttributes; | ||
for (var k in attrs) { | ||
if (k.toLowerCase() === k2) { | ||
key = k; | ||
break; | ||
} | ||
} | ||
attrs[key] = String(value); | ||
// update this.attrs | ||
if (this._attrs) { | ||
this._attrs[key] = decode(attrs[key]); | ||
this._attrs[k2] = decode(attrs[key]); | ||
} | ||
@@ -592,0 +600,0 @@ // Update rawString |
{ | ||
"name": "node-html-parser", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
168160
4566