-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add autofix for empty-tag-not-self-closed rule
#341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+212
−1
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta name="description" content="Empty Tag Not Self-Closed Test" /> | ||
| <title>Empty Tag Not Self-Closed Test</title> | ||
| </head> | ||
| <body> | ||
| <!-- Test case 1: br tag (should be converted to self-closing) --> | ||
| <br> | ||
|
|
||
| <!-- Test case 2: img tag (should be converted to self-closing) --> | ||
| <img src="test.jpg" alt="Test"> | ||
|
|
||
| <!-- Test case 3: hr tag (should be converted to self-closing) --> | ||
| <hr> | ||
|
|
||
| <!-- Test case 4: input tag (should be converted to self-closing) --> | ||
| <input type="text"> | ||
|
|
||
| <!-- Test case 5: meta tag (should be converted to self-closing) --> | ||
| <meta name="test" content="test"> | ||
|
|
||
| <!-- Test case 6: link tag (should be converted to self-closing) --> | ||
| <link rel="stylesheet" href="style.css"> | ||
|
|
||
| <!-- Test case 7: area tag (should be converted to self-closing) --> | ||
| <area shape="rect" coords="0,0,100,100" href="#"> | ||
|
|
||
| <!-- Test case 8: base tag (should be converted to self-closing) --> | ||
| <base href="https://example.com"> | ||
|
|
||
| <!-- Test case 9: col tag (should be converted to self-closing) --> | ||
| <col span="2"> | ||
|
|
||
| <!-- Test case 10: embed tag (should be converted to self-closing) --> | ||
| <embed src="test.swf" type="application/x-shockwave-flash"> | ||
|
|
||
| <!-- Test case 11: source tag (should be converted to self-closing) --> | ||
| <source src="test.mp4" type="video/mp4"> | ||
|
|
||
| <!-- Test case 12: track tag (should be converted to self-closing) --> | ||
| <track src="subtitles.vtt" kind="subtitles" srclang="en"> | ||
|
|
||
| <!-- Test case 13: wbr tag (should be converted to self-closing) --> | ||
| <wbr> | ||
coliff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- Test case 14: Already self-closing tags - should not trigger --> | ||
| <br /> | ||
| <img src="test2.jpg" alt="Test 2" /> | ||
| <hr /> | ||
|
|
||
| <!-- Test case 15: Non-void elements with content - should not trigger --> | ||
| <div>Content</div> | ||
| <p>Paragraph content</p> | ||
|
|
||
| <!-- Test case 16: Empty non-void elements - should not trigger --> | ||
| <div></div> | ||
| <p></p> | ||
| </body> | ||
| </html> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.