Skip to content

feat(search): scroll to match and highlight term from search results#134

Merged
robvanderveer merged 2 commits intoOWASP:mainfrom
northdpole:main
Feb 15, 2026
Merged

feat(search): scroll to match and highlight term from search results#134
robvanderveer merged 2 commits intoOWASP:mainfrom
northdpole:main

Conversation

@northdpole
Copy link
Collaborator

  • Add ?highlight= to result links (use matched term from when present, else search query) and navigate with location.assign
  • On load: find first occurrence of highlight term in main content (.docs-body / .docs-content first to avoid sidebar/TOC), scroll into view (window or scroll parent), apply brief block highlight
  • Wrap matched word in span with yellow highlight for 20s then fade out
  • Fix AOS init (run on DOMContentLoaded, try/catch) to avoid null setAttribute error
  • Search: open with /, focus input on open (retry until Pagefind injects input), Escape to close

northdpole and others added 2 commits February 15, 2026 21:50
- Add ?highlight= to result links (use matched term from <mark> when present, else search query) and navigate with location.assign
- On load: find first occurrence of highlight term in main content (.docs-body / .docs-content first to avoid sidebar/TOC), scroll into view (window or scroll parent), apply brief block highlight
- Wrap matched word in span with yellow highlight for 20s then fade out
- Fix AOS init (run on DOMContentLoaded, try/catch) to avoid null setAttribute error
- Search: open with /, focus input on open (retry until Pagefind injects input), Escape to close
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 80a3e27):

https://owasp-ai-exchange--pr134-main-tm2ciow8.web.app

(expires Wed, 18 Feb 2026 21:51:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 02f5be6553e943b45baa816c0cdb95d3b659492a

@robvanderveer robvanderveer merged commit 0d032c4 into OWASP:main Feb 15, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants