Skip to content
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

"Some attributes are required to be followed by ..." #8978

Open
Zectbumo opened this issue Mar 3, 2023 · 2 comments
Open

"Some attributes are required to be followed by ..." #8978

Zectbumo opened this issue Mar 3, 2023 · 2 comments

Comments

@Zectbumo
Copy link

Zectbumo commented Mar 3, 2023

https://html.spec.whatwg.org/multipage/syntax.html#start-tags:space-characters-3

Some attributes are required to be followed by a space.

I can't find any evidence of this being true in the referenced spec following the selected text. What attributes would require to be followed by a space??

@domenic
Copy link
Member

domenic commented Mar 3, 2023

I agree, this doesn't seem correct. The only thing I can think of is if it's saying something like <img src=https://example.com/foo/> is bad and <img src=https://example.com/foo /> is OK. But point 6 already kind of covers that.

@zcorpan has a good history of remembering or grokking what this kind of old spec text means, so let's see if he has any ideas. Otherwise, we should remove this.

@zcorpan
Copy link
Member

zcorpan commented Mar 3, 2023

Empty attribute syntax
If an attribute using the empty attribute syntax is to be followed by another attribute, then there must be ASCII whitespace separating the two.

Unquoted, single-quoted and double-quoted also need a space if followed by another attribute.

Unquoted attribute value syntax
If an attribute using the unquoted attribute syntax is to be followed by another attribute or by the optional U+002F SOLIDUS character (/) allowed in step 6 of the start tag syntax above, then there must be ASCII whitespace separating the two.

Example:

<br class=foo />

(removing the space makes the slash part of the attribute value)

The text in step 6 of start tag is not a "must" requirement.

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

No branches or pull requests

3 participants