htmljs-parser 3.0.0 → 3.1.0
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/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1043,7 +1043,11 @@ var EXPRESSION = {
|
|
|
1043
1043
|
},
|
|
1044
1044
|
eol(_, expression) {
|
|
1045
1045
|
if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
|
|
1046
|
-
this
|
|
1046
|
+
if (checkForOperators(this, expression)) {
|
|
1047
|
+
this.forward = 1;
|
|
1048
|
+
} else {
|
|
1049
|
+
this.exitState();
|
|
1050
|
+
}
|
|
1047
1051
|
}
|
|
1048
1052
|
},
|
|
1049
1053
|
eof(expression) {
|
|
@@ -1071,7 +1075,7 @@ var EXPRESSION = {
|
|
|
1071
1075
|
}
|
|
1072
1076
|
};
|
|
1073
1077
|
function buildOperatorPattern(isConcise) {
|
|
1074
|
-
const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(
|
|
1078
|
+
const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!^\\s*|-)-${isConcise ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!${isConcise ? "^\\s*|" : ""}\\.)\\.(?!\\.)|<${isConcise ? "{2,}|(?<!^\\s*)<" : "+"}|>${isConcise ? "+" : "{2,}"}|\\bin(?:stanceof)?(?=\\s+[^=/,;:>])`;
|
|
1075
1079
|
const unary = "\\b(?:a(?:sync|wait)|class|function|new|typeof|void)\\b";
|
|
1076
1080
|
const lookAheadPattern = "\\s*(?:" + binary + `)\\s*|\\s+(?=[${isConcise ? "" : "["}{(])`;
|
|
1077
1081
|
const lookBehindPattern = `(?<=${unary}|${binary})`;
|
package/dist/index.mjs
CHANGED
|
@@ -1023,7 +1023,11 @@ var EXPRESSION = {
|
|
|
1023
1023
|
},
|
|
1024
1024
|
eol(_, expression) {
|
|
1025
1025
|
if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
|
|
1026
|
-
this
|
|
1026
|
+
if (checkForOperators(this, expression)) {
|
|
1027
|
+
this.forward = 1;
|
|
1028
|
+
} else {
|
|
1029
|
+
this.exitState();
|
|
1030
|
+
}
|
|
1027
1031
|
}
|
|
1028
1032
|
},
|
|
1029
1033
|
eof(expression) {
|
|
@@ -1051,7 +1055,7 @@ var EXPRESSION = {
|
|
|
1051
1055
|
}
|
|
1052
1056
|
};
|
|
1053
1057
|
function buildOperatorPattern(isConcise) {
|
|
1054
|
-
const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(
|
|
1058
|
+
const binary = `[!~*%&^|?:]+|(?<=[!=<>&^~|/*?%+-])=|=(?=[!=<>&^~|/*?%+-])|(?<!\\+)\\s*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!^\\s*|-)-${isConcise ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!${isConcise ? "^\\s*|" : ""}\\.)\\.(?!\\.)|<${isConcise ? "{2,}|(?<!^\\s*)<" : "+"}|>${isConcise ? "+" : "{2,}"}|\\bin(?:stanceof)?(?=\\s+[^=/,;:>])`;
|
|
1055
1059
|
const unary = "\\b(?:a(?:sync|wait)|class|function|new|typeof|void)\\b";
|
|
1056
1060
|
const lookAheadPattern = "\\s*(?:" + binary + `)\\s*|\\s+(?=[${isConcise ? "" : "["}{(])`;
|
|
1057
1061
|
const lookBehindPattern = `(?<=${unary}|${binary})`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "htmljs-parser",
|
|
3
3
|
"description": "An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"author": "Phillip Gates-Idem <phillip.idem@gmail.com>",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@commitlint/cli": "^16.2.3",
|