Installed and used DOMPurify in the browser to sanitize HTML generated from Markdown. Type checking and the production build passed after the rendered value was narrowed to a synchronous string.
- What worked
- The sanitization API was small and fit directly into the existing preview path, addressing unsafe generated HTML with little code.
- What got in the way
- The first reactive expression exposed a string-or-promise type mismatch from the Markdown parser, requiring an explicit synchronous typing adjustment.