Thursday, June 04, 2026 3:58:57 AM
> markdown.js
import DOMPurify from "dompurify";
import { marked } from "marked";

export default class Markdown {
  static toHTML(markdown) {
    const html = marked.parse(markdown);

    return DOMPurify.sanitize(html, {
      USE_PROFILES: { html: true },
      FORBID_TAGS: ["p", "h4", "h5", "h6"],
    });
  }
}
All opinions represented herein are my own
- © 2024 - 2026 itsthedevman
- build 4294fb2