gfast-html-parser
Advanced tools
Comparing version 1.0.4 to 1.0.5
13
index.js
@@ -382,6 +382,13 @@ require('apollojs'); | ||
if (this.rawAttrs) { | ||
var re = /\b(([a-z][a-z0-9\-]*)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))|\b([a-z][a-z0-9\-]+))/gi; | ||
for (var match; match = re.exec(this.rawAttrs); ) | ||
attrs[match[1]] = match[3] || match[4] || match[5]; | ||
let re2 = /\b([a-z][a-z0-9\-]*)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/; | ||
let res = this.rawAttrs.match(re); | ||
for (let i = i, t = res.length; i < t; ++i) { | ||
let match = res[i].match(re2); | ||
if (match) { | ||
attrs[match[1]] = match[3] || match[4] || match[5]; | ||
} else { | ||
attrs[res[i]] = ''; | ||
} | ||
} | ||
} | ||
@@ -388,0 +395,0 @@ this._rawAttrs = attrs; |
{ | ||
"name": "gfast-html-parser", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A very fast HTML parser, generating a simplified DOM, with basic element query support.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
69780
755