From 510325c64dfbdfcca43a3437ce353cb00e62ee25 Mon Sep 17 00:00:00 2001 From: Roni Axelrad Date: Sat, 16 May 2026 13:18:46 -0400 Subject: [PATCH] fix: make sure the find do not skip CODE and PRE areas. The find did not find text in those area editors before, with this fix, it does. --- src/lib/components/FindBar.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/FindBar.svelte b/src/lib/components/FindBar.svelte index fc0c7ca..8f6425f 100644 --- a/src/lib/components/FindBar.svelte +++ b/src/lib/components/FindBar.svelte @@ -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 s. const tag = el.tagName; return ( - tag === 'CODE' || - tag === 'PRE' || tag === 'SCRIPT' || tag === 'STYLE' || tag === 'NOSCRIPT' ||