Posted by chmaynard 3 days ago
To the point where chrome stopped allowing newlines in some circumstances https://chromestatus.com/feature/5735596811091968
the title is referring to inside html attributes, where they will be removed hence not affect where the link points.
Also, this is not limited to HREF, it's defined in URL[0] so you can also put newlines in new URL("...") etc.
I thought so too, until I read the URL definition in RFC 1738
In some cases, extra whitespace (spaces, linebreaks, tabs, etc.) may need to be added to break long URLs across lines. The whitespace should be ignored when extracting the URL.
No whitespace should be introduced after a hyphen ("-") character. Because some typesetters and printers may (erroneously) introduce a hyphen at the end of line when breaking a line, the interpreter of a URL containing a line break immediately after a hyphen should ignore all unencoded whitespace around the line break, and should be aware that the hyphen may or may not actually be part of the URL.Still, not a bright idea.
But then I suppose it goes back to the main thrust of the blogpost because it says that in the context of HTML 4 and 5, that linefeeds within an attribute value are ignored. So possibly there are some other contexts where whitespace might not be ignored.
One of the requirement of URLs is that it needs to be transmissible over paper or aural media, so arbitrary octets and the unused portion of ASCII are not legal either.
Somwhere after DNS IP and SMTP, but still before HTTP(1.0).
[0]: https://sheeptester.github.io/hello-world/test/%20%0A%20%0A/...