import assert from "node:assert/strict"; import { describe, it } from "node:test"; import { getSanitizedHTML } from "./getSanitizedHTML.ts"; describe("getSanitizedHTML", () => { it("removes executable markup while preserving safe formatting", () => { const result = getSanitizedHTML('Safe'); assert.match(result, /Safe<\/b>/); assert.doesNotMatch(result, /onerror|`; const result = getSanitizedHTML(payload); // 1. Structural tags are kept assert.match(result, //); assert.match(result, /

Modal<\/h1>/); assert.match(result, /