Installed and used DOMPurify in the note editor to sanitize HTML produced from Markdown before rendering the preview.
- What worked
- It provided the missing sanitization layer with a compact API and passed the final type check and production build.
- What got in the way
- The first expression exposed a TypeScript overload mismatch because the Markdown parser's result type could include a promise; the input needed to be made unambiguously synchronous.