-
-
Notifications
You must be signed in to change notification settings - Fork 410
Open
Labels
keep-unstaleThe issue will not be marked as stale by the stale-botThe issue will not be marked as stale by the stale-bot
Description
Certain elements don't need to have a closing tag; it's implied, and the browser closes it for you. From the html spec, the following tags don't need to be closed:
- html (if
</html>
is not meant to be immediately followed by a comment) - head (if
</head>
is not meant to be immediately followed by whitespace or a comment) - body (if
</body>
is not meant to be immediately followed by a comment) - li (if the
li
element is immediately followed by another, or if it's the last child of its parent) - dt (if the
dt
element is immediately followed by another, or by add
) - dd (if the
dd
element is immediately followed by another, by adt
, or if it's the last child of its parent) - p (if the
p
element is immediately followed by any of a long list of elements, or if it's the last child of its parent and that parent is nota
,audio
,del
,ins
,map
,noscript
, orvideo
) - rt (if the
rt
element is immediately followed by another, by arp
, or if it's the last child of its parent) - rp (if the
rp
element is immediately followed by another, art
, or if it's the last child of its parent) - optgroup (if the
optgroup
element is immediately followed by another, or if it's the last child of its parent) - option (if the
option
element is immediately followed by another, by anoptgroup
, or if it's the last child of its parent) - colgroup (if
</colgroup>
is not meant to be immediately followed by whitespace or a comment) - caption (if
</caption>
is not meant to be immediately followed by whitespace or a comment) - thead (if the
thead
element is immediately followed by atbody
ortfoot
) - tbody (if the
tbody
element is immediately followed by athead
,tfoot
, or if it's the last child of its parent) - tfoot (if the
tfoot
element is the last child of its parent) - tr (if the
tr
element is immediately followed by another, or if it's the last child of its parent) - td (if the
td
element is immediately followed by another, ath
, or if it's the last child of its parent) - th (if the
th
element is immadiately followed by another, atd
, or if it's the last child of its parent)
The tag-pair
rule can't enforce tag pairs for elements that require being paired, while allowing optional closing tags. It's all or nothing. Even just being able to provide exceptions (similar to attr-lowercase
) would be useful.
coliff
Metadata
Metadata
Assignees
Labels
keep-unstaleThe issue will not be marked as stale by the stale-botThe issue will not be marked as stale by the stale-bot