Skip to content

Implement more helpful error message that is caused by <foo unquoted=/> #101

Description

@zcorpan

See whatwg/html#2665

In particular for foreign content, when an end tag is missing and the start tag had / as the last character in of an unquoted attribute value before the >, a probable cause of the error is that self-closing tag was intended.

Activity

  1. j9t commented on Dec 8, 2025

    @j9t

    @zcorpan, can you advise what we should change exactly?

    The only scenario that looks incorrect when we do throw an error (that we can make more helpful) seems to be something like this:

    <!doctype html>
    <title>Test</title>
    <foo-bar unquoted=/>

    But even in a case like this, we throw “Unclosed element foo-bar.” It doesn’t specifically call out the slash but seems to point in the right direction (element is not closed).

    I may be missing something and perhaps when we closed whatwg/html#2665, this became moot, too, but happy to look into this if there’s something specific to adjust.

  2. zcorpan commented on Dec 9, 2025

    @zcorpan
    ContributorAuthor

    A more likely scenario is when the attribute value is something more than a single / and the element supports self-closing (i.e. is an SVG or MathML element) as in <svg><circle r=1 class=foo/></svg>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions