diff --git a/src/views/LibraryView.tsx b/src/views/LibraryView.tsx index 10af803..65b97a1 100644 --- a/src/views/LibraryView.tsx +++ b/src/views/LibraryView.tsx @@ -14,8 +14,21 @@ import { useLibrary } from '../hooks/useLibrary'; import { bulkExportZip, exportMeeting, type ExportFormat } from '../lib/export'; import type { MeetingWithPreview, SortDirection, SortField, ViewMode } from '../types'; +function sanitizeSearchSnippetHtml(html: string): string { + const escaped = html + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + + return escaped + .replace(/<mark>/g, '') + .replace(/<\/mark>/g, ''); +} + function renderSearchSnippet(html: string): { __html: string } { - return { __html: html }; + return { __html: sanitizeSearchSnippetHtml(html) }; } function SkeletonLine({ className }: { className: string }) {