Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/lib/components/FindBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

function isHostElement(el: Element | null): boolean {
if (!el) return false;
// Skip elements whose text is not user-visible (script/style/noscript)
// and our own find marks (to avoid re-walking already-highlighted text).
// CODE and PRE intentionally NOT skipped: code blocks contain real
// content the user expects to be searchable, even when highlight.js
// has wrapped tokens in nested <span>s.
const tag = el.tagName;
return (
tag === 'CODE' ||
tag === 'PRE' ||
tag === 'SCRIPT' ||
tag === 'STYLE' ||
tag === 'NOSCRIPT' ||
Expand Down
Loading