Skip to content

Commit a1e0e7d

Browse files
committed
Add test cases for void elements with trailing whitespace
Expanded the test suite to include void HTML elements (hr, input, br, img) with trailing whitespace to verify they are converted to self-closing tags. Also updated test case numbering for clarity.
1 parent 3237969 commit a1e0e7d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/autofix/empty-tag-not-self-closed-test.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,22 @@
4646
<!-- Test case 13: wbr tag (should be converted to self-closing) -->
4747
<wbr>
4848

49-
<!-- Test case 14: Already self-closing tags - should not trigger -->
49+
<!-- Test case 14: Void elements with trailing whitespace (should be converted to self-closing) -->
50+
<hr >
51+
<input type="text" >
52+
<br >
53+
<img src="test3.jpg" alt="Test 3" >
54+
55+
<!-- Test case 15: Already self-closing tags - should not trigger -->
5056
<br />
5157
<img src="test2.jpg" alt="Test 2" />
5258
<hr />
5359

54-
<!-- Test case 15: Non-void elements with content - should not trigger -->
60+
<!-- Test case 16: Non-void elements with content - should not trigger -->
5561
<div>Content</div>
5662
<p>Paragraph content</p>
5763

58-
<!-- Test case 16: Empty non-void elements - should not trigger -->
64+
<!-- Test case 17: Empty non-void elements - should not trigger -->
5965
<div></div>
6066
<p></p>
6167
</body>

0 commit comments

Comments
 (0)