WarUI

Opt-in trusted HTML with sanitizer hook

GRID-A07-F27P1beyond-baselinePlanned

When HTML output is genuinely needed, a column can set `html: true`. The grid then requires a sanitizer function, for example an app-provided DOMPurify-style sanitizer, or a TrustedHTML value. Without a sanitizer the column refuses to render HTML and falls back to escaped text.

Planned. This page shows the specification from issue #184. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A snippets grid with html:true and a demo sanitizer that allows b, i, a[href] and code.

Expected behavior

With a sanitizer, allowed tags render and disallowed tags are removed. Without one, the HTML appears as escaped text and a warning is logged.

Planned API surface

htmlsanitizeHtmlGridOptions.sanitizerTrustedHTMLonSanitize

Acceptance criteria

  • html:true without a sanitizer renders escaped text and logs one warning. (pending)
  • Sanitizer output is passed through the link-protocol allowlist for href and src. (pending)
  • Under Trusted Types, only a TrustedHTML or a sanitizer wrapped in a policy is accepted. (pending)
  • No sanitizer library is bundled, so the core keeps zero dependencies. (pending)