sindresorhus/refined-github

Error truncating `#:~:text=` URL #4165

dnknn posted onGitHub

For example #:~:text= URLs :

https://github.com/sindresorhus/refined-github/issues/3686#gh-csc-3:~:text=register%20for%20the%20(free)%20developer%20account

or

https://github.com/sindresorhus/refined-github/issues/3686#:~:text=register%20for%20the%20(free)%20developer%20account

✔️ Expected correct behavior: see image 🖼

❌ Current error behavior (live demo) : 👇

https://github.com/sindresorhus/refined-github/issues/3686#gh-csc-3:~:text=register%20for%20the%20(free)%20developer%20account https://github.com/sindresorhus/refined-github/issues/3686#:~:text=register%20for%20the%20(free)%20developer%20account

The beginning of :~:text=....... will be truncated, so the original anchor function of the API link is lost.


About :~:text=....... API (Chrome⁸¹ᐩ ):

image

//Bookmarklet
javascript:if(target=prompt("⚓", location.href+'#:~:text=' +window.getSelection())) {window.open(target);}

📖 Documentation :

https://developer.chrome.com/blog/new-in-chrome-80

https://github.com/WICG/scroll-to-text-fragment

https://wicg.github.io/scroll-to-text-fragment/

https://web.dev/text-fragments/#text-fragments


Thanks for the detailed report, but it's unrelated to Refined GitHub

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests