Loading...

HTML sinks

AGENTS.md and proposed

an element never writes its own properties, attributes, data or fetched text as HTML unsanitized. Use `textContent` for text, or run the value through `sanitizeHTMLString` (`@haxtheweb/utils/lib/sanitize.js`) before `innerHTML`, `insertAdjacentHTML`, `unsafeHTML` or a `.innerHTML` binding. ESLint enforces this (`haxtheweb-html/unsanitized-html-sink`, `scripts/eslint-rules/html-sinks.mjs`); hits that predate the rule are recorded in `eslint-suppressions.json`. In the AGENTS.md of components. Nothing enforces this yet.

Status: gap

Connects to

Links