Skip to content

Commit

Permalink
Help developers better understand self-closing-tag syntax
Browse files Browse the repository at this point in the history
* Clarify that the solidus character in an HTML-element start tag doesn’t mark the HTML element as self-closing.

* Explicitly caution developers that the solidus character, if directly preceded by an unquoted attribute value, becomes part of the attribute value rather than being discarded by the parser.
  • Loading branch information
sideshowbarker authored Oct 5, 2022
1 parent f3550cd commit d63708f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -106626,8 +106626,12 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {

<li>Then, if the element is one of the <span>void elements</span>, or if the element is a <span
data-x="foreign elements">foreign element</span>, then there may be a single U+002F SOLIDUS
character (/). This character has no effect on <span>void elements</span>, but on <span>foreign
elements</span> it marks the start tag as self-closing.</li>
character (/), which on <span>foreign elements</span> marks the start tag as self-closing. On
<span>void elements</span>, it does not mark the start tag as self-closing but instead is
unnecessary and has no effect of any kind. For such void elements, it should be used only with
caution — especially since, if directly preceded by an <a href="#unquoted">unquoted attribute
value</a>, it becomes part of the attribute value rather than being discarded by the
parser.</li>.

<li>Finally, start tags must be closed by a U+003E GREATER-THAN SIGN character (&gt;).</li>
</ol>
Expand Down

0 comments on commit d63708f

Please sign in to comment.