-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generateFragmentFromRange
from fragment-generation-utils.js
is broken, infinite loop (Chrome, Safari, Firefox)
#164
Comments
Thank you! Just released |
I tested on this page: https://text-fragments-polyfill.glitch.me => ... so it's better than a seemingly infinite loop, but clearly something is wrong, somewhere :) |
Thank you for releasing |
Hi, I am using text-fragments-polyfill in a Chrome extension that highlights webpages. I am encountering failures with 6.x that were not present in 5.7.6 that I think relate to this current issue. E.g. if you:
Then the outcomes differ between 5.7.6 and 6.x.
6.0.0 and 6.1.0 both log AMBIGUOUS:
whereas 5.7.6 logs:
![]() |
I don't see a release/branch for 5.7.6, but based on the dates from NPM, I think this is the correct diff. I will start poking around to see if I have any idea what changed. :) |
Tested with
[email protected]
and[email protected]
.To reproduce:
selectionchange
event to avoid floodinggenerateFragmentFromRange()
calls).Unlike this original Javascript codebase, my TypeScript port runs but the TextFragment generation fails due to the "embiggen" logic not managing to create a unique TextFragment with prefix/suffix. I will report back here if / when I figure out what's going on :) (I "fixed" a couple of issues, notably in the text accumulator, perhaps that's why the original JS code loops indefinitely)
The text was updated successfully, but these errors were encountered: