Re: [whatwg/url] Grammar specification for URLs (#24)

I concur with @TimothyGu's response.

I also wonder whether it's truly impossible and/or unhelpful to take the "basic URL parser", throw out everything that causes a validation error or returns failure, and create a formal grammar from that. The spec is written from the point of view of not being hindered by recoverable issues for the sake of interoperability on the Web, but just because you _can_ parse something into a URL doesn't mean you want to _encourage_ any old thing.

I think a case could be made that a formal grammar from which a finite state acceptor can be made would be useful to certain audiences. ("Hey you! Person who entered this supposed URL! I won't let you continue unless you do it right.")

If nothing else, it would help those who might endeavor to write a regular expression to detect URLs and auto-link them, for example. You're not about to go implement the URL parser and run it on any arbitrary text in order to do that.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/24#issuecomment-420493981

Received on Wednesday, 12 September 2018 02:48:31 UTC