htmljs-parser 5.0.2 → 5.0.3
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 -3
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1042,7 +1042,10 @@ var EXPRESSION = {
|
|
|
1042
1042
|
this.pos++;
|
|
1043
1043
|
break;
|
|
1044
1044
|
default: {
|
|
1045
|
-
if (
|
|
1045
|
+
if (canCharCodeBeFollowedByDivision(this.getPreviousNonWhitespaceCharCode())) {
|
|
1046
|
+
this.pos++;
|
|
1047
|
+
this.consumeWhitespace();
|
|
1048
|
+
} else {
|
|
1046
1049
|
this.enterState(states_exports.REGULAR_EXPRESSION);
|
|
1047
1050
|
}
|
|
1048
1051
|
break;
|
|
@@ -1103,9 +1106,9 @@ var EXPRESSION = {
|
|
|
1103
1106
|
};
|
|
1104
1107
|
function buildPattern(type) {
|
|
1105
1108
|
const space = type === 1 /* CONCISE_ATTRS */ ? "[ \\t]" : "\\s";
|
|
1106
|
-
const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!-)-${type === 1 /* CONCISE_ATTRS */ ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(
|
|
1109
|
+
const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!-)-${type === 1 /* CONCISE_ATTRS */ ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<!\\.)\\.(?!\\.)|>${type === 0 /* HTML_ATTRS */ ? "{2,}" : "+"}|[ \\t]+(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
|
|
1107
1110
|
const unary = "\\b(?<![.]\\s*)(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
|
|
1108
|
-
const lookAheadPattern = `${space}*(?:${binary})\\s*|${space}+(?=[{(])`;
|
|
1111
|
+
const lookAheadPattern = `${space}*(?:${binary})\\s*|${space}+(?=[{(]|/[^>])`;
|
|
1109
1112
|
const lookBehindPattern = `(?<=${unary}|${binary})`;
|
|
1110
1113
|
return new RegExp(`${lookAheadPattern}|${lookBehindPattern}`, "ym");
|
|
1111
1114
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1021,7 +1021,10 @@ var EXPRESSION = {
|
|
|
1021
1021
|
this.pos++;
|
|
1022
1022
|
break;
|
|
1023
1023
|
default: {
|
|
1024
|
-
if (
|
|
1024
|
+
if (canCharCodeBeFollowedByDivision(this.getPreviousNonWhitespaceCharCode())) {
|
|
1025
|
+
this.pos++;
|
|
1026
|
+
this.consumeWhitespace();
|
|
1027
|
+
} else {
|
|
1025
1028
|
this.enterState(states_exports.REGULAR_EXPRESSION);
|
|
1026
1029
|
}
|
|
1027
1030
|
break;
|
|
@@ -1082,9 +1085,9 @@ var EXPRESSION = {
|
|
|
1082
1085
|
};
|
|
1083
1086
|
function buildPattern(type) {
|
|
1084
1087
|
const space = type === 1 /* CONCISE_ATTRS */ ? "[ \\t]" : "\\s";
|
|
1085
|
-
const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!-)-${type === 1 /* CONCISE_ATTRS */ ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(
|
|
1088
|
+
const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:\\s*\\+\\s*\\+)*\\s*(?!\\+)|(?<!-)-${type === 1 /* CONCISE_ATTRS */ ? "" : "(?:\\s*-\\s*-)*\\s*"}(?!-)|(?<!\\.)\\.(?!\\.)|>${type === 0 /* HTML_ATTRS */ ? "{2,}" : "+"}|[ \\t]+(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
|
|
1086
1089
|
const unary = "\\b(?<![.]\\s*)(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
|
|
1087
|
-
const lookAheadPattern = `${space}*(?:${binary})\\s*|${space}+(?=[{(])`;
|
|
1090
|
+
const lookAheadPattern = `${space}*(?:${binary})\\s*|${space}+(?=[{(]|/[^>])`;
|
|
1088
1091
|
const lookBehindPattern = `(?<=${unary}|${binary})`;
|
|
1089
1092
|
return new RegExp(`${lookAheadPattern}|${lookBehindPattern}`, "ym");
|
|
1090
1093
|
}
|
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": "5.0.
|
|
4
|
+
"version": "5.0.3",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@changesets/changelog-github": "^0.4.4",
|
|
7
7
|
"@changesets/cli": "^2.22.0",
|