-
Notifications
You must be signed in to change notification settings - Fork 6
HTML Hint showcase #19
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"tag-pair": true, | ||
"attr-value-double-quotes": true, | ||
"doctype-first": true, | ||
"id-unique": true | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<title>Bad Page<title> | ||
</head> | ||
<body> | ||
<h1>Welcome | ||
<img src="image.jpg"> | ||
<p>This paragraph is missing its closing tag | ||
<a href="about.html">About us | ||
<ul> | ||
<li>Item 1 | ||
<li>Item 2 | ||
</ul | ||
</body> | ||
</html> | ||
Comment on lines
+1
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document lacks DOCTYPE and several closing tags – HTMLHint will flag this. Right now the first fragment violates every rule you just enabled:
Unless the goal is to demonstrate failing cases, consider fixing them so the file passes lint: +<!DOCTYPE html> <html> <head> - <title>Bad Page<title> + <title>Bad Page</title> </head> <body> - <h1>Welcome - <img src="image.jpg"> - <p>This paragraph is missing its closing tag - <a href="about.html">About us - <ul> - <li>Item 1 - <li>Item 2 - </ul + <h1>Welcome</h1> + <img src="image.jpg" alt="Sample image"> + <p>This paragraph is now properly closed.</p> + <a href="about.html">About us</a> + <ul> + <li>Item 1</li> + <li>Item 2</li> + </ul> </body> </html> 📝 Committable suggestion
Suggested change
<html>
<head>
<title>Bad Page<title>
</head>
<body>
<h1>Welcome
<img src="image.jpg">
<p>This paragraph is missing its closing tag
<a href="about.html">About us
<ul>
<li>Item 1
<li>Item 2
</ul
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Bad Page</title>
</head>
<body>
<h1>Welcome</h1>
<img src="image.jpg" alt="Sample image">
<p>This paragraph is now properly closed.</p>
<a href="about.html">About us</a>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</body>
</html>
🧰 Tools🪛 HTMLHint (1.5.0)[error] 1-1: Doctype must be declared before any non-comment content. (doctype-first) [error] 3-3: Tag must be paired, missing: [ </title></title> ], start tag match failed [ <title> ] on line 3. (tag-pair) [error] 12-12: Tag must be paired, missing: [ ], start tag match failed [(tag-pair) 🤖 Prompt for AI Agents
|
||
<html><body><h1>Oops<img src="a.png"></body></html> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Two complete HTML documents in one file – split or comment out. Line 16 embeds a second 🧰 Tools🪛 HTMLHint (1.5.0)[error] 16-16: Tag must be paired, missing: [ </h1> ], start tag match failed [ <h1> ] on line 16. (tag-pair) 🤖 Prompt for AI Agents
|