diff --git a/.changeset/spicy-baboons-buy.md b/.changeset/spicy-baboons-buy.md new file mode 100644 index 000000000..7ea226886 --- /dev/null +++ b/.changeset/spicy-baboons-buy.md @@ -0,0 +1,5 @@ +--- +"gitbook": patch +--- + +Fix bug in search highlight in GBO diff --git a/packages/gitbook/src/components/Search/HighlightQuery.tsx b/packages/gitbook/src/components/Search/HighlightQuery.tsx index c54796a7c..794d16f7d 100644 --- a/packages/gitbook/src/components/Search/HighlightQuery.tsx +++ b/packages/gitbook/src/components/Search/HighlightQuery.tsx @@ -15,6 +15,8 @@ export function HighlightQuery(props: { query, text, highlight = [ + '-z-1', + 'relative', 'text-bold', 'bg-primary', 'text-contrast-primary', @@ -33,7 +35,7 @@ export function HighlightQuery(props: { const matches = matchString(text, query); return ( - + {matches.map((entry, index) => ( {entry.text}