// safe-mount.safe.ts import { ALLOWED_URI_REGEX, sanitize_external } from "./sanitize-html.utils.js"; const DANGEROUS_TAGS = new Set([ "script", "style", "iframe", "object", "embed", "link", "meta", "base", "form", "input", "video", "audio" ]); /*********************************************** * mount_html_safe * * Safely mount untrusted HTML into a target element. * * Pipeline: * 1. Runs the raw HTML through `sanitize_external`, which: * - parses via DOMPurify (or equivalent), * - strips disallowed tags/attrs/URLs, * - returns a trusted HTML string. * 2. Parses the sanitized string via a `