-
Notifications
You must be signed in to change notification settings - Fork 408
Add text fragments to quarto-search.js items #14003
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
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
The PR looks good. Just to be clear, this exists in part to improve the situation we have wrt visibility of search results in the page, right? |
Yes, this will be helpful for all search results, but will be especially helpful once we have tabsets that have behaviour that they switch tabs to reveal specific content in response to browser ctrl+f or text fragment links. I am looking into using the |
|
Should we merge this? Whats the next release it will be in? Will it be in a "daily" sort of build before the main release so that we can use it in a build of the quarto.org docs? |
Yes I'll build the new prerelease, and we can see effect in quarto.org |
|
1.9.20 has the change |
|
Probably worth taking a look at this discussion as it's about text fragments and query parameters in URL. Especially, the following part which is involving in removing the search text highlighting
|
Description
Adds text fragments to items in search. Example video:
Kapture.2026-02-06.at.12.51.59.mp4
I have attempted to write this code quite defensively so that it will not break things. Its not quite the ideal place for this code since this piece of code can be called multiple time for a single item, but it gets the job done.
Text fragments are well supported and apparently browsers will fall back to id linking if the text fragment is not supported or found (worked in my testing in chrome and safari and firefox on Desktop MacOS Tahoe, e.g. https://en.wikipedia.org/wiki/Dog#Domestication:~:text=blablabla).