htmljs-parser 3.3.2 → 3.3.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 CHANGED
@@ -1097,7 +1097,7 @@ var EXPRESSION = {
1097
1097
  }
1098
1098
  };
1099
1099
  function buildOperatorPattern(isConcise) {
1100
- const binary = `(?:[!~*%&^|?:<]+=*)+|[>/+-=]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1100
+ const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1101
1101
  const unary = "\\b(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
1102
1102
  const lookAheadPattern = "[ \\t]*(?:" + binary + `)[ \\t]*|[ \\t]+(?=[{(])`;
1103
1103
  const lookBehindPattern = `(?<=${unary}|${binary})`;
@@ -1924,8 +1924,10 @@ var OPEN_TAG = {
1924
1924
  } else if (code === 47 /* FORWARD_SLASH */ && !tag.hasAttrs) {
1925
1925
  tag.stage = 1 /* VAR */;
1926
1926
  this.pos++;
1927
+ if (isWhitespaceCode(this.lookAtCharCodeAhead(0))) {
1928
+ return this.emitError(this.pos, 23 /* MISSING_TAG_VARIABLE */, "A slash was found that was not followed by a variable name or lhs expression");
1929
+ }
1927
1930
  const expr = this.enterState(states_exports.EXPRESSION);
1928
- expr.skipOperators = true;
1929
1931
  expr.terminatedByWhitespace = true;
1930
1932
  expr.terminator = this.isConcise ? CONCISE_TAG_VAR_TERMINATORS : HTML_TAG_VAR_TERMINATORS;
1931
1933
  this.pos--;
package/dist/index.mjs CHANGED
@@ -1076,7 +1076,7 @@ var EXPRESSION = {
1076
1076
  }
1077
1077
  };
1078
1078
  function buildOperatorPattern(isConcise) {
1079
- const binary = `(?:[!~*%&^|?:<]+=*)+|[>/+-=]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1079
+ const binary = `(?:[!~*%&^|?<]+=*)+|:+(?!=)|[>/+=-]+=|=>|(?<!\\+)[ \\t]*\\+(?:[ \\t]*\\+[ \\t]*\\+)*[ \\t]*(?!\\+)|(?<!-)-${isConcise ? "" : "(?:[ \\t]*-[ \\t]*-)*[ \\t]*"}(?!-)|(?<![/*])/(?![/*${isConcise ? "" : ">"}])|(?<!\\.)\\.(?!\\.)|>${isConcise ? "+" : "{2,}"}|\\b(?:in(?:stanceof)?|as|extends)(?=[ \\t]+[^=/,;:>])`;
1080
1080
  const unary = "\\b(?:a(?:sync|wait)|keyof|class|function|new|typeof|void)\\b";
1081
1081
  const lookAheadPattern = "[ \\t]*(?:" + binary + `)[ \\t]*|[ \\t]+(?=[{(])`;
1082
1082
  const lookBehindPattern = `(?<=${unary}|${binary})`;
@@ -1903,8 +1903,10 @@ var OPEN_TAG = {
1903
1903
  } else if (code === 47 /* FORWARD_SLASH */ && !tag.hasAttrs) {
1904
1904
  tag.stage = 1 /* VAR */;
1905
1905
  this.pos++;
1906
+ if (isWhitespaceCode(this.lookAtCharCodeAhead(0))) {
1907
+ return this.emitError(this.pos, 23 /* MISSING_TAG_VARIABLE */, "A slash was found that was not followed by a variable name or lhs expression");
1908
+ }
1906
1909
  const expr = this.enterState(states_exports.EXPRESSION);
1907
- expr.skipOperators = true;
1908
1910
  expr.terminatedByWhitespace = true;
1909
1911
  expr.terminator = this.isConcise ? CONCISE_TAG_VAR_TERMINATORS : HTML_TAG_VAR_TERMINATORS;
1910
1912
  this.pos--;
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.3.2",
4
+ "version": "3.3.3",
5
5
  "devDependencies": {
6
6
  "@changesets/changelog-github": "^0.4.4",
7
7
  "@changesets/cli": "^2.22.0",