node-html-parser 6.1.4 → 6.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/main.js +2 -2
- package/dist/nodes/html.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [6.1.5](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.4...v6.1.5) (2023-02-21)
|
|
6
|
+
|
|
5
7
|
### [6.1.4](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.3...v6.1.4) (2022-11-15)
|
|
6
8
|
|
|
7
9
|
|
package/dist/main.js
CHANGED
|
@@ -1044,14 +1044,14 @@ define("nodes/html", ["require", "exports", "css-select", "he", "back", "matcher
|
|
|
1044
1044
|
}
|
|
1045
1045
|
var attrs = {};
|
|
1046
1046
|
if (this.rawAttrs) {
|
|
1047
|
-
var re = /([a-zA-Z()[\]
|
|
1047
|
+
var re = /([a-zA-Z()[\]#@$.?:][a-zA-Z0-9-_:()[\]#]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
|
|
1048
1048
|
var match = void 0;
|
|
1049
1049
|
while ((match = re.exec(this.rawAttrs))) {
|
|
1050
1050
|
var key = match[1];
|
|
1051
1051
|
var val = match[2] || null;
|
|
1052
1052
|
if (val && (val[0] === "'" || val[0] === "\""))
|
|
1053
1053
|
val = val.slice(1, val.length - 1);
|
|
1054
|
-
attrs[key] = val;
|
|
1054
|
+
attrs[key] = attrs[key] || val;
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
this._rawAttrs = attrs;
|
package/dist/nodes/html.js
CHANGED
|
@@ -711,14 +711,14 @@ var HTMLElement = /** @class */ (function (_super) {
|
|
|
711
711
|
}
|
|
712
712
|
var attrs = {};
|
|
713
713
|
if (this.rawAttrs) {
|
|
714
|
-
var re = /([a-zA-Z()[\]
|
|
714
|
+
var re = /([a-zA-Z()[\]#@$.?:][a-zA-Z0-9-_:()[\]#]*)(?:\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+))?/g;
|
|
715
715
|
var match = void 0;
|
|
716
716
|
while ((match = re.exec(this.rawAttrs))) {
|
|
717
717
|
var key = match[1];
|
|
718
718
|
var val = match[2] || null;
|
|
719
719
|
if (val && (val[0] === "'" || val[0] === "\""))
|
|
720
720
|
val = val.slice(1, val.length - 1);
|
|
721
|
-
attrs[key] = val;
|
|
721
|
+
attrs[key] = attrs[key] || val;
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
this._rawAttrs = attrs;
|
package/package.json
CHANGED