whatwg / url

URL Standard
https://url.spec.whatwg.org/
Other
527 stars 137 forks source link

invalid-reverse-solidus error definition has character mixed up. #772

Open JamesNJep opened 1 year ago

JamesNJep commented 1 year ago

Under the host passing section https://url.spec.whatwg.org/#host-parsing

What I think it is trying to say is that the URL scheme uses the solidus character U+002F (/) and not the reverse solidus character U+005C (), but the characters seem to be in the wrong order in the sentence above the example.

annevk commented 1 year ago

Are you talking about https://url.spec.whatwg.org/#invalid-reverse-solidus?

The characters after the scheme are correct, but those are not the ones in error. The ones later on are.

JamesNJep commented 1 year ago

Yes was talking about https://url.spec.whatwg.org/#invalid-reverse-solidus thank you for looking at this.

The part I had trouble understanding is the description sentence above the example. The description text reads

"The URL has a special scheme and it uses U+005C () instead of U+002F (/)."

The way I have read and interpreted this when first reading this is that the sentence is making a statement, about how the URL should be written to avoid this error, but I think the sentence is actually trying to make a positive statement to describe the error condition.

I've re-read this table several times and I think the other items in the table are easier to understand because they use words or prases like, "exceeds", "improper", "too many", "too few", "too big", "invalid" that make it clear that the statement is describing an error state.

I think if the sentence was written more like the desciption for https://url.spec.whatwg.org/#example-host-missing and used "but" instead of "and" that would make it easier to understood the statment was describing the error condition if someone is jumping directly to that description. For example if it was written like this

"The URL has a special scheme, but has used U+005C () in the place of U+002F (/)."

annevk commented 1 year ago

I'm not sure how to apply that consistently. Many of these are statements describing the error state in exactly that fashion, e.g.,

An IPv4 address ends with a U+002E (.).

Although, maybe we should remove "instead of U+002F (/)" or put that between parenthesis? Nothing else has advice like that so maybe removing it would be best and make it clearer overall.

What do you think?