Skip to content

Commit 3892651

Browse files
erikaraujobrendt
andauthored
fix(view): InvalidClosingTag should ignore commented out code attributes (#1288)
Co-authored-by: Brent Roose <[email protected]>
1 parent e34e120 commit 3892651

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/view/tests/TempestViewParserTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ public function test_invalid_closing_tag(): void
7676
new TempestViewParser($tokens)->parse();
7777
}
7878

79+
public function test_invalid_closing_tag_ignores_commented_out_code(): void
80+
{
81+
$tokens = new TempestViewLexer(<<<HTML
82+
<h1>
83+
<!-- <svg xmlns="http://www.w3.org/2000/svg">
84+
</svg> -->
85+
</h1>
86+
HTML)->lex();
87+
88+
$compiled = new TempestViewParser($tokens)->parse()->compile();
89+
$this->assertSame(<<<HTML
90+
<h1>
91+
<!-- <svg xmlns="http://www.w3.org/2000/svg">
92+
</svg> -->
93+
</h1>
94+
HTML, $compiled);
95+
}
96+
7997
public function test_doctype(): void
8098
{
8199
$tokens = new TokenCollection([

0 commit comments

Comments
 (0)