Skip to content

Commit f599070

Browse files
committed
Use normal link tags for Tailwind Plus urls in search modal
1 parent b3db23a commit f599070

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/components/search.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,24 @@ export function SearchProvider({ children }: React.PropsWithChildren) {
232232
}
233233

234234
function Hit({ hit, children }: { hit: any; children: React.ReactNode }) {
235+
if (isTailwindPlusURL(hit.url)) {
236+
return (
237+
<a
238+
href={hit.url}
239+
className={clsx({
240+
"DocSearch-Hit--Result": hit.__is_result?.(),
241+
"DocSearch-Hit--Parent": hit.__is_parent?.(),
242+
"DocSearch-Hit--FirstChild": hit.__is_first?.(),
243+
"DocSearch-Hit--LastChild": hit.__is_last?.(),
244+
"DocSearch-Hit--Child": hit.__is_child?.(),
245+
"DocSearch-Hit--TailwindUI": hit.__is_tailwindui?.(),
246+
})}
247+
>
248+
{children}
249+
</a>
250+
)
251+
}
252+
235253
return (
236254
<Link
237255
href={hit.url}

0 commit comments

Comments
 (0)