Return Text Fragments for linking to highlights?
karlhorky opened this issue · 0 comments
karlhorky commented
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.
- 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
- 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
Ideas for implementation can be inspired by the doGenerateFragment
function in fragment-generation-utils.js
from the text-fragments-polyfill
package: