Skip to content

Commit 06d94ac

Browse files
committed
Revert "refactor(compiler): Add info about unclosed element."
This reverts commit 0972084.
1 parent 0972084 commit 06d94ac

2 files changed

Lines changed: 4 additions & 21 deletions

File tree

packages/compiler/src/ml_parser/parser.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -753,30 +753,13 @@ class _TreeBuilder {
753753
}
754754

755755
private _consumeBlockClose(token: BlockCloseToken) {
756-
const initialStackLength = this._containerStack.length;
757-
const topNode = this._containerStack[initialStackLength - 1];
758756
if (!this._popContainer(null, html.Block, token.sourceSpan)) {
759-
if (this._containerStack.length < initialStackLength) {
760-
const nodeName = topNode instanceof html.Component ? topNode.fullName : topNode.name;
761-
this.errors.push(
762-
TreeError.create(
763-
null,
764-
token.sourceSpan,
765-
`Unexpected closing block. The block may have been closed earlier. ` +
766-
`Did you forget to close the <${nodeName}> element? ` +
767-
`If you meant to write the \`}\` character, you should use the "&#125;" ` +
768-
`HTML entity instead.`,
769-
),
770-
);
771-
return;
772-
}
773-
774757
this.errors.push(
775758
TreeError.create(
776759
null,
777760
token.sourceSpan,
778761
`Unexpected closing block. The block may have been closed earlier. ` +
779-
`If you meant to write the \`}\` character, you should use the "&#125;" ` +
762+
`If you meant to write the } character, you should use the "&#125;" ` +
780763
`HTML entity instead.`,
781764
),
782765
);

packages/compiler/test/ml_parser/html_parser_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ describe('HtmlParser', () => {
11081108
expect(humanizeErrors(errors)).toEqual([
11091109
[
11101110
null,
1111-
'Unexpected closing block. The block may have been closed earlier. If you meant to write the `}` character, you should use the "&#125;" HTML entity instead.',
1111+
'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "&#125;" HTML entity instead.',
11121112
'0:5',
11131113
],
11141114
]);
@@ -1120,7 +1120,7 @@ describe('HtmlParser', () => {
11201120
expect(humanizeErrors(errors)).toEqual([
11211121
[
11221122
null,
1123-
'Unexpected closing block. The block may have been closed earlier. Did you forget to close the <strong> element? If you meant to write the `}` character, you should use the "&#125;" HTML entity instead.',
1123+
'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "&#125;" HTML entity instead.',
11241124
'0:21',
11251125
],
11261126
]);
@@ -1137,7 +1137,7 @@ describe('HtmlParser', () => {
11371137
],
11381138
[
11391139
null,
1140-
'Unexpected closing block. The block may have been closed earlier. If you meant to write the `}` character, you should use the "&#125;" HTML entity instead.',
1140+
'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "&#125;" HTML entity instead.',
11411141
'0:28',
11421142
],
11431143
]);

0 commit comments

Comments
 (0)