htmljs-parser 3.2.2 → 3.2.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
@@ -1069,7 +1069,10 @@ var EXPRESSION = {
1069
1069
  },
1070
1070
  eol(_, expression) {
1071
1071
  if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
1072
- this.exitState();
1072
+ if (checkForOperators(this, expression))
1073
+ this.forward = 1;
1074
+ else
1075
+ this.exitState();
1073
1076
  }
1074
1077
  },
1075
1078
  eof(expression) {
@@ -1107,7 +1110,7 @@ function checkForOperators(parser, expression) {
1107
1110
  if (expression.skipOperators) {
1108
1111
  return false;
1109
1112
  }
1110
- const pattern = parser.isConcise ? conciseOperatorPattern : htmlOperatorPattern;
1113
+ const pattern = parser.isConcise || expression.terminatedByEOL ? conciseOperatorPattern : htmlOperatorPattern;
1111
1114
  pattern.lastIndex = parser.pos;
1112
1115
  const matches = pattern.exec(parser.data);
1113
1116
  if (matches) {
package/dist/index.mjs CHANGED
@@ -1048,7 +1048,10 @@ var EXPRESSION = {
1048
1048
  },
1049
1049
  eol(_, expression) {
1050
1050
  if (!expression.groupStack.length && (expression.terminatedByWhitespace || expression.terminatedByEOL)) {
1051
- this.exitState();
1051
+ if (checkForOperators(this, expression))
1052
+ this.forward = 1;
1053
+ else
1054
+ this.exitState();
1052
1055
  }
1053
1056
  },
1054
1057
  eof(expression) {
@@ -1086,7 +1089,7 @@ function checkForOperators(parser, expression) {
1086
1089
  if (expression.skipOperators) {
1087
1090
  return false;
1088
1091
  }
1089
- const pattern = parser.isConcise ? conciseOperatorPattern : htmlOperatorPattern;
1092
+ const pattern = parser.isConcise || expression.terminatedByEOL ? conciseOperatorPattern : htmlOperatorPattern;
1090
1093
  pattern.lastIndex = parser.pos;
1091
1094
  const matches = pattern.exec(parser.data);
1092
1095
  if (matches) {
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.2.2",
4
+ "version": "3.2.3",
5
5
  "author": "Phillip Gates-Idem <phillip.idem@gmail.com>",
6
6
  "devDependencies": {
7
7
  "@commitlint/cli": "^16.2.3",