htmljs-parser 5.4.3 → 5.5.1
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 +24 -7
- package/dist/index.mjs +24 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1378,12 +1378,14 @@ var CONCISE_HTML_CONTENT = {
|
|
|
1378
1378
|
parentTag = this.activeTag;
|
|
1379
1379
|
}
|
|
1380
1380
|
if (!parentTag && curIndent) {
|
|
1381
|
-
|
|
1382
|
-
this.
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1381
|
+
if (code !== 47 /* FORWARD_SLASH */) {
|
|
1382
|
+
this.emitError(
|
|
1383
|
+
this.pos,
|
|
1384
|
+
7 /* INVALID_INDENTATION */,
|
|
1385
|
+
"Line has extra indentation at the beginning"
|
|
1386
|
+
);
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1387
1389
|
}
|
|
1388
1390
|
if (parentTag) {
|
|
1389
1391
|
if (parentTag.type === 1 /* text */ && code !== 45 /* HTML_BLOCK_DELIMITER */) {
|
|
@@ -1886,7 +1888,22 @@ function lookAheadForOperator(data, pos) {
|
|
|
1886
1888
|
}
|
|
1887
1889
|
}
|
|
1888
1890
|
function canFollowDivision(code) {
|
|
1889
|
-
|
|
1891
|
+
if (isWordCode(code))
|
|
1892
|
+
return true;
|
|
1893
|
+
switch (code) {
|
|
1894
|
+
case 96 /* BACKTICK */:
|
|
1895
|
+
case 39 /* SINGLE_QUOTE */:
|
|
1896
|
+
case 34 /* DOUBLE_QUOTE */:
|
|
1897
|
+
case 37 /* PERCENT */:
|
|
1898
|
+
case 41 /* CLOSE_PAREN */:
|
|
1899
|
+
case 46 /* PERIOD */:
|
|
1900
|
+
case 60 /* OPEN_ANGLE_BRACKET */:
|
|
1901
|
+
case 93 /* CLOSE_SQUARE_BRACKET */:
|
|
1902
|
+
case 125 /* CLOSE_CURLY_BRACE */:
|
|
1903
|
+
return true;
|
|
1904
|
+
default:
|
|
1905
|
+
return false;
|
|
1906
|
+
}
|
|
1890
1907
|
}
|
|
1891
1908
|
function isWordCode(code) {
|
|
1892
1909
|
return code >= 65 /* UPPER_A */ && code <= 90 /* UPPER_Z */ || code >= 97 /* LOWER_A */ && code <= 122 /* LOWER_Z */ || code >= 48 /* NUMBER_0 */ && code <= 57 /* NUMBER_9 */ || code == 36 /* DOLLAR */ || code === 95 /* UNDERSCORE */;
|
package/dist/index.mjs
CHANGED
|
@@ -1353,12 +1353,14 @@ var CONCISE_HTML_CONTENT = {
|
|
|
1353
1353
|
parentTag = this.activeTag;
|
|
1354
1354
|
}
|
|
1355
1355
|
if (!parentTag && curIndent) {
|
|
1356
|
-
|
|
1357
|
-
this.
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1356
|
+
if (code !== 47 /* FORWARD_SLASH */) {
|
|
1357
|
+
this.emitError(
|
|
1358
|
+
this.pos,
|
|
1359
|
+
7 /* INVALID_INDENTATION */,
|
|
1360
|
+
"Line has extra indentation at the beginning"
|
|
1361
|
+
);
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1362
1364
|
}
|
|
1363
1365
|
if (parentTag) {
|
|
1364
1366
|
if (parentTag.type === 1 /* text */ && code !== 45 /* HTML_BLOCK_DELIMITER */) {
|
|
@@ -1861,7 +1863,22 @@ function lookAheadForOperator(data, pos) {
|
|
|
1861
1863
|
}
|
|
1862
1864
|
}
|
|
1863
1865
|
function canFollowDivision(code) {
|
|
1864
|
-
|
|
1866
|
+
if (isWordCode(code))
|
|
1867
|
+
return true;
|
|
1868
|
+
switch (code) {
|
|
1869
|
+
case 96 /* BACKTICK */:
|
|
1870
|
+
case 39 /* SINGLE_QUOTE */:
|
|
1871
|
+
case 34 /* DOUBLE_QUOTE */:
|
|
1872
|
+
case 37 /* PERCENT */:
|
|
1873
|
+
case 41 /* CLOSE_PAREN */:
|
|
1874
|
+
case 46 /* PERIOD */:
|
|
1875
|
+
case 60 /* OPEN_ANGLE_BRACKET */:
|
|
1876
|
+
case 93 /* CLOSE_SQUARE_BRACKET */:
|
|
1877
|
+
case 125 /* CLOSE_CURLY_BRACE */:
|
|
1878
|
+
return true;
|
|
1879
|
+
default:
|
|
1880
|
+
return false;
|
|
1881
|
+
}
|
|
1865
1882
|
}
|
|
1866
1883
|
function isWordCode(code) {
|
|
1867
1884
|
return code >= 65 /* UPPER_A */ && code <= 90 /* UPPER_Z */ || code >= 97 /* LOWER_A */ && code <= 122 /* LOWER_Z */ || code >= 48 /* NUMBER_0 */ && code <= 57 /* NUMBER_9 */ || code == 36 /* DOLLAR */ || code === 95 /* UNDERSCORE */;
|
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.
|
|
4
|
+
"version": "5.5.1",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@changesets/changelog-github": "^0.4.7",
|
|
7
7
|
"@changesets/cli": "^2.25.2",
|