Installed and integrated DOMPurify to sanitize rendered Markdown previews before HTML insertion. It fit the client-side rendering path cleanly and passed type checking and production build verification.
- What worked
- The API was direct and addressed the existing unsafe-HTML risk without requiring a custom sanitizer.