htmljs-parser 2.10.0 → 2.11.2
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/Parser.js +15 -16
- package/package.json +1 -1
- package/test/autotest/argument-tag/expected.html +7 -0
- package/test/autotest/argument-tag/input.htmljs +3 -1
- package/test/autotest/attr-method-shorthand/expected.html +14 -40
- package/test/autotest/attr-method-shorthand/input.htmljs +14 -4
- package/test/autotest/attr-unenclosed-whitespace-multiple-attrs/expected.html +5 -0
- package/test/autotest/{attr-unenclosed-whitespace-no-comma → attr-unenclosed-whitespace-multiple-attrs}/input.htmljs +0 -0
- package/test/autotest/attr-unenclosed-whitespace-no-comma/expected.html +0 -1
package/Parser.js
CHANGED
|
@@ -429,16 +429,6 @@ class Parser extends BaseParser {
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
|
|
433
|
-
if (currentOpenTag.hasUnenclosedWhitespace && attributes.length > 1) {
|
|
434
|
-
for(let i = 0; i < attributes.length-1; i++) {
|
|
435
|
-
if(!attributes[i].endedWithComma) {
|
|
436
|
-
notifyError(attributes[i].pos,
|
|
437
|
-
'COMMAS_REQUIRED',
|
|
438
|
-
'commas are required to separate all attributes when using complex attribute values with un-enclosed whitespace');
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
432
|
}
|
|
443
433
|
|
|
444
434
|
|
|
@@ -2208,7 +2198,13 @@ class Parser extends BaseParser {
|
|
|
2208
2198
|
openTagEOL();
|
|
2209
2199
|
}
|
|
2210
2200
|
return;
|
|
2211
|
-
} else if (
|
|
2201
|
+
} else if (
|
|
2202
|
+
currentPart.parentState === STATE_TAG_NAME ||
|
|
2203
|
+
(isConcise && (
|
|
2204
|
+
currentPart.parentState === STATE_TAG_ARGS ||
|
|
2205
|
+
currentPart.parentState === STATE_WITHIN_OPEN_TAG)
|
|
2206
|
+
)
|
|
2207
|
+
) {
|
|
2212
2208
|
currentPart.endPos = parser.pos;
|
|
2213
2209
|
endExpression();
|
|
2214
2210
|
|
|
@@ -2606,11 +2602,14 @@ class Parser extends BaseParser {
|
|
|
2606
2602
|
parser.rewind(1);
|
|
2607
2603
|
parser.enterState(STATE_WITHIN_OPEN_TAG);
|
|
2608
2604
|
return;
|
|
2609
|
-
} else if (
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2605
|
+
} else if (
|
|
2606
|
+
parser.lookAtCharCodeAhead(1) === CODE_OPEN_PAREN &&
|
|
2607
|
+
(currentPart.parentState === STATE_TAG_NAME || currentPart.value)
|
|
2608
|
+
) {
|
|
2609
|
+
currentPart.value += ch;
|
|
2610
|
+
endExpression();
|
|
2611
|
+
parser.enterState(STATE_TAG_ARGS);
|
|
2612
|
+
return;
|
|
2614
2613
|
}
|
|
2615
2614
|
}
|
|
2616
2615
|
}
|
package/package.json
CHANGED
|
@@ -1,40 +1,14 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
text:"
|
|
14
|
-
|
|
15
|
-
<foo DEFAULT=function(event) {
|
|
16
|
-
console.log("hello");
|
|
17
|
-
event.preventDefault();
|
|
18
|
-
} SELF_CLOSED>
|
|
19
|
-
</foo>
|
|
20
|
-
text:"\n"
|
|
21
|
-
text:"\n"
|
|
22
|
-
<foo DEFAULT=function(event) {
|
|
23
|
-
console.log("hello");
|
|
24
|
-
event.preventDefault();
|
|
25
|
-
} SELF_CLOSED>
|
|
26
|
-
</foo>
|
|
27
|
-
text:"\n"
|
|
28
|
-
text:"\n"
|
|
29
|
-
<foo VAR=(bar) DEFAULT=function(event) {
|
|
30
|
-
console.log("hello");
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
} SELF_CLOSED>
|
|
33
|
-
</foo>
|
|
34
|
-
text:"\n"
|
|
35
|
-
text:"\n"
|
|
36
|
-
<foo VAR=(bar) DEFAULT=function(event) {
|
|
37
|
-
console.log("hello");
|
|
38
|
-
event.preventDefault();
|
|
39
|
-
} SELF_CLOSED>
|
|
40
|
-
</foo>
|
|
1
|
+
<let VAR=(count) DEFAULT=0>
|
|
2
|
+
</let>
|
|
3
|
+
<effect DEFAULT=function() {
|
|
4
|
+
const interval = setInterval(() => {
|
|
5
|
+
count += 1
|
|
6
|
+
}, 1000);
|
|
7
|
+
return () => clearInterval(interval)
|
|
8
|
+
}>
|
|
9
|
+
</effect>
|
|
10
|
+
<div>
|
|
11
|
+
text:"The count is "
|
|
12
|
+
${"$escapeXml(count)"}
|
|
13
|
+
text:"!"
|
|
14
|
+
</div>
|
|
@@ -18,12 +18,22 @@
|
|
|
18
18
|
event.preventDefault();
|
|
19
19
|
}/>
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
foo onclick(event) {
|
|
22
22
|
console.log("hello");
|
|
23
23
|
event.preventDefault();
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
foo onclick (event) {
|
|
27
|
+
console.log("hello");
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
foo(event) {
|
|
32
|
+
console.log("hello");
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
}
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
foo (event) {
|
|
27
37
|
console.log("hello");
|
|
28
38
|
event.preventDefault();
|
|
29
|
-
}
|
|
39
|
+
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
error:"commas are required to separate all attributes when using complex attribute values with un-enclosed whitespace" (code: "COMMAS_REQUIRED")
|