WICG/scroll-to-text-fragment

Is there any way to only target headers and not content?

dead-claudia opened this issue · 3 comments

I couldn't tell you how many times I had to say "Click this page and scroll to X" because there was no way to select a header and get its click ID. Prior to Markdown and related tools, having IDs for headers was exceedingly rare, and it still is fairly uncommon on blog posts to convert headers into anchors.

It'd be nice to be able to search only by header, and most of the time that's all I would want to search.

I think the answer here would be to add additional context text to help disambiguate the header, as stated in #4.

The updated proposal and prototype now supports context snippets so you can disambiguate headers. e.g., Try Chrome Canary with chrome://flags#enable-text-fragment-anchor: https://github.com/bokand/ScrollToTextFragment#targetText=way.-,Highlight,-The

I think we can close this issue?

I think this use case is addressed with the existing syntax. Feel free to elaborate if I missed something.