bryanmcquade / scroll-to-css-selector

Explainer for supporting CSS selectors when navigating to a URL fragment
61 stars 1 forks source link

Support for these more complex URLs in services #3

Open stucox opened 6 years ago

stucox commented 6 years ago

Is it worth adding a mention that there's a potential usability dependency on URL parsing libs/algorithms being updated?

Commonly used services which will identify & link a URL in a block of text (GitHub Markdown, Twitter, Facebook, etc) are unlikely to identify this more complex syntax as a compete URL. Hence people will be apprehensive about using selector targets, even as anchor hrefs in hand-written HTML, as their users may not be able to easily share such links.

Similarly I imagine URL parsing libraries for major programming languages may need to be extended/updated to ensure they handle this syntax as expected, otherwise such URLs may not be usable in combination with software written with those languages (e.g. forms using Django's URLField may not allow them).

This looks like a big hurdle: if the ecosystem & wider web needs a lot of engineering work support this syntax, it's use will be very limited.

tigt commented 6 years ago

Parentheses characters have always been valid inside fragments; SVG fragments such as svgView() have used this for longer than the last decade.

See also: An Improved Liberal, Accurate Regex Pattern for Matching URLs

stucox commented 6 years ago

True, but if existing tooling still doesn't support it, the scope for this to be useful becomes quite limited.