scroll-to-css-selector icon indicating copy to clipboard operation
scroll-to-css-selector copied to clipboard

What does targetElement=.foo&bar match?

Open jakearchibald opened this issue 7 years ago • 2 comments

targetElement=.foo&bar

Does the selector parsing end at &? It feels like it should if you're going with a urlencoded style.

jakearchibald avatar May 22 '18 12:05 jakearchibald

If I understand correctly, if one wants an ampersand selector inside targetElement, it should be URL-encoded as %26.

Otherwise, Jake’s interpretation would override the selector.

tigt avatar May 25 '18 04:05 tigt

This is where the parenthetical style would really clarify things. Hard to misread this variation: #targetElement(.foo&bar). Additionally, it opens the door back up for sites to use hash fragments in a query parameter style: #targetElement(.foo&bar)&pid=5 (where pid is a site specific page id or something).

BigBlueHat avatar May 25 '18 17:05 BigBlueHat