diff --git a/src/lib/components/notes/utils.ts b/src/lib/components/notes/utils.ts index 46a7ea8458..164f98619b 100644 --- a/src/lib/components/notes/utils.ts +++ b/src/lib/components/notes/utils.ts @@ -1,3 +1,5 @@ +import DOMPurify from 'dompurify'; + export const downloadPdf = async (note) => { const [{ default: jsPDF }, { default: html2canvas }] = await Promise.all([ import('jspdf'), @@ -9,7 +11,7 @@ export const downloadPdf = async (note) => { const virtualHeight = 1400; // Fixed height (adjust as needed) // STEP 1. Get a DOM node to render - const html = note.data?.content?.html ?? ''; + const html = DOMPurify.sanitize(note.data?.content?.html ?? ''); const isDarkMode = document.documentElement.classList.contains('dark'); let node;