Skip to content
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

Return Text Fragments for linking to highlights? #26

Open
karlhorky opened this issue Oct 15, 2023 · 0 comments
Open

Return Text Fragments for linking to highlights? #26

karlhorky opened this issue Oct 15, 2023 · 0 comments

Comments

@karlhorky
Copy link

karlhorky commented Oct 15, 2023

Hi @bvaughn, thanks for this package, very useful!

I wanted to see whether you'd be open to also returning a Text Fragment (blog post) in addition to the chunks matched in a string.

Eg.

  1. Returning the Text Fragment Modules in Web for usage in the URL below, for matching and scrolling to that part of the page:
    https://blog.chromium.org/2019/12/chrome-80-content-indexing-es-modules.html#:~:text=Modules%20in%20Web
    Screenshot 2023-10-15 at 22 29 35

  2. Returning the Text Fragment details%20about%20the-,API,-%2C%20see%20Experimenting%20with for usage in the URL below, for matching a specific instance of API in the page:
    https://blog.chromium.org/2019/12/chrome-80-content-indexing-es-modules.html#:~:text=details%20about%20the-,API,-%2C%20see%20Experimenting%20with
    Screenshot 2023-10-15 at 22 32 50

Ideas for implementation can be inspired by the doGenerateFragment function in fragment-generation-utils.js from the text-fragments-polyfill package:

https://github.com/GoogleChromeLabs/text-fragments-polyfill//blob/e5252cb6eba768cdc4166b27cbe8080fc67f37c7/src/fragment-generation-utils.js#L145-L243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant