Skip to content

Repository meta-issue: Linter configuration re: void elements #40338

@ferdnyc

Description

@ferdnyc

In my latest PR, I noticed that the [mdn-linter] is "correcting" tags like <img ...> to <img ... />. It... really shouldn't.

The standard, on the use of trailing / characters in (void element) start tags:

Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/), which on foreign elements marks the start tag as self-closing. On void elements, 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 unquoted attribute value, it becomes part of the attribute value rather than being discarded by the parser.

Originally posted by @ferdnyc in #40337 (comment)

"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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: wontfixOut of scope, too much effort, or working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions