Skip to content

Commit 427ff19

Browse files
authored
[Docs Site] Decode HTML entities in InstantSearch titles (#23313)
1 parent 28c59b9 commit 427ff19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/search/InstantSearch.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
} from "@floating-ui/react";
2323
import { PiCaretDownBold } from "react-icons/pi";
2424
import { setSearchParams } from "~/util/url";
25+
import he from "he";
2526

2627
function SearchBox(props: UseSearchBoxProps) {
2728
const { query, refine } = useSearchBox(props);
@@ -79,7 +80,7 @@ function InfiniteHits(props: UseInfiniteHitsProps) {
7980
href={item.url}
8081
className="border-cl1-gray-8 hover:bg-cl1-gray-9 dark:border-cl1-gray-2 dark:bg-cl1-gray-0 dark:hover:bg-cl1-gray-1 flex flex-col rounded-sm border p-6 text-black! no-underline"
8182
>
82-
<strong>{title}</strong>
83+
<strong>{he.decode(title)}</strong>
8384
<p className="line-clamp-2">
8485
<Highlight attribute="content" hit={item} />
8586
</p>

0 commit comments

Comments
 (0)