node-html-parser
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -226,3 +226,3 @@ var __extends = (this && this.__extends) || (function () { | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -232,3 +232,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -242,3 +242,3 @@ // for (let cls = classes, i = 0; i < cls.length; i++) {if (el.classNames.indexOf(cls[i]) === -1){ return false;}} | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -248,3 +248,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -257,3 +257,3 @@ // return true; | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -263,3 +263,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -1026,2 +1026,6 @@ }, | ||
var kMarkupPattern = /<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.:0-9_a-z]*)\s*([^>]*?)(\/?)>/ig; | ||
// <(?<tag>[^\s]*)(.*)>(.*)</\k<tag>> | ||
// <([a-z][-.:0-9_a-z]*)\s*\/> | ||
// <(area|base|br|col|hr|img|input|link|meta|source)\s*(.*)\/?> | ||
// <(area|base|br|col|hr|img|input|link|meta|source)\s*(.*)\/?>|<(?<tag>[^\s]*)(.*)>(.*)</\k<tag>> | ||
var kAttributePattern = /(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig; | ||
@@ -1138,3 +1142,3 @@ var kSelfClosingElements = { | ||
for (var attMatch = void 0; (attMatch = kAttributePattern.exec(match[3]));) { | ||
attrs[attMatch[2]] = attMatch[4] || attMatch[5] || attMatch[6]; | ||
attrs[attMatch[2].toLowerCase()] = attMatch[4] || attMatch[5] || attMatch[6]; | ||
} | ||
@@ -1141,0 +1145,0 @@ var tagName = currentParent.rawTagName; |
@@ -77,3 +77,3 @@ "use strict"; | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -83,3 +83,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -93,3 +93,3 @@ // for (let cls = classes, i = 0; i < cls.length; i++) {if (el.classNames.indexOf(cls[i]) === -1){ return false;}} | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -99,3 +99,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -108,3 +108,3 @@ // return true; | ||
classes = classes || []; | ||
attr_key = attr_key || ''; | ||
attr_key = (attr_key || '').toLowerCase(); | ||
value = value || ''; | ||
@@ -114,3 +114,3 @@ var attrs = el.attributes; | ||
var val = attrs[key]; | ||
return key === attr_key && val === value; | ||
return key.toLowerCase() === attr_key && val === value; | ||
}); | ||
@@ -117,0 +117,0 @@ }, |
@@ -634,2 +634,6 @@ "use strict"; | ||
var kMarkupPattern = /<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.:0-9_a-z]*)\s*([^>]*?)(\/?)>/ig; | ||
// <(?<tag>[^\s]*)(.*)>(.*)</\k<tag>> | ||
// <([a-z][-.:0-9_a-z]*)\s*\/> | ||
// <(area|base|br|col|hr|img|input|link|meta|source)\s*(.*)\/?> | ||
// <(area|base|br|col|hr|img|input|link|meta|source)\s*(.*)\/?>|<(?<tag>[^\s]*)(.*)>(.*)</\k<tag>> | ||
var kAttributePattern = /(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig; | ||
@@ -746,3 +750,3 @@ var kSelfClosingElements = { | ||
for (var attMatch = void 0; (attMatch = kAttributePattern.exec(match[3]));) { | ||
attrs[attMatch[2]] = attMatch[4] || attMatch[5] || attMatch[6]; | ||
attrs[attMatch[2].toLowerCase()] = attMatch[4] || attMatch[5] || attMatch[6]; | ||
} | ||
@@ -749,0 +753,0 @@ var tagName = currentParent.rawTagName; |
{ | ||
"name": "node-html-parser", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"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
116516
3053