-
Notifications
You must be signed in to change notification settings - Fork 43
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
Why can't multiple texts be highlighted on the same page? #252
Comments
This is working as intended. If you want to link to more than one text fragment, use the syntax as per the article. Here's an example link: https://blog.chromium.org/2019/12/chrome-80-content-indexing-es-modules.html#:~:text=Text%20URL%20Fragments&text=text,-parameter&text=:~:text=On%20islands,%20birds%20can%20contribute%20as%20much%20as%2060%25%20of%20a%20cat's%20diet |
Thanks @tomayac but your comment is about the sentences. I was asking about a single word repeated multiple times in the content. For example, the link you posted has seven 'context' words but only one is highlighted. https://blog.chromium.org/2019/12/chrome-80-content-indexing-es-modules.html#:~:text=context Don't you think this should highlight more than one word? |
The algorithm searches for the first matching instance of the word (or word sequence). As I said, if you want to link to all instances, you'd have to hand-craft the URL so that it includes multiple text fragments separated by |
@tomayac I'm trying to explain that the algorithm is incomplete, or at least of no use to me in its current form. As far as I understand, this feature is sentence-oriented and offered for short answers of a few words. However, I wanted to use it for both words and sentences, but there is no such option. Therefore you should extend the code to highlight the same word more than once. I've used this feature on many websites, but I'm having to remove it from all of them after realizing it only works once for the entire content. I'm writing a module myself for a similar feature, and for exampple, for the word 'data', I think the way it should work is below. |
This Issue is essentially asking the same as #107 and should be closed as a duplicate thereof. The feature request is valid, but as stated here and in the linked Issue, currently the only alternative is to manually create multiple text fragments, which may or may not work for all use cases. |
@tomayac It's been almost four years since that 😲, but it seems like you still haven't planned it. I added this feature thinking it would work this way in all the work I do, but now that I've removed it, I have to deal with all my customers now. That's why, as you see, I am writing a module and this unplanned work will take me all day. Sorry but it would be better if you implemented this instead of proposing to close this. Of course, you can close this if you want🤔 |
I agree with @tomayac - this is a duplicate of #107 so I'll close in favor of that one. This is a valid feature request but isn't the use case we were targeting when initially designing this feature. As such, it would require some additional thought and consideration (in addition to implementation work in browsers) so isn't something I'm planning to take up in the near term. I'm hoping to merge this feature into the HTML standard. Once that happens feature improvements can happen on this as they do by the usual process in HTML. |
@bokand I wrote this in the post above because I predicted this.
Your answer is more acceptable as it explains the reasons rather than ignoring the problem compared to others. Anyway, I already done my own business. |
I liked this feature, but it only evaluates the first text element. For example sent the link in the your Issues tab.
https://github.com/WICG/scroll-to-text-fragment/issues#:~:text=opened
Is there any parameter or something else to specify same texts?
The text was updated successfully, but these errors were encountered: