From 86e4c291c0987630a728735d98fd1da114a56955 Mon Sep 17 00:00:00 2001 From: Nicholas Griffin Date: Sun, 25 Aug 2024 02:43:41 +0100 Subject: [PATCH] fix: don't use document --- apps/web/app/components/homepage/search-result-item.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/web/app/components/homepage/search-result-item.tsx b/apps/web/app/components/homepage/search-result-item.tsx index bc760c6..e0c414d 100644 --- a/apps/web/app/components/homepage/search-result-item.tsx +++ b/apps/web/app/components/homepage/search-result-item.tsx @@ -2,9 +2,7 @@ import { Button } from '../ui/button'; import { Modal } from '../modal/base'; function stripHtmlTags(html: string): string { - const div = document.createElement('div'); - div.innerHTML = html; - return div.textContent || div.innerText || ''; + return html.replace(/<\/?[^>]+(>|$)/g, ''); } export const SearchResultItem = ({