Opt-in trusted HTML with pluggable sanitizer
A column can render rich HTML only when it explicitly sets an html render mode. Output then passes through a sanitizer. WarGrid ships a small allowlist sanitizer and lets teams plug in their own, and it refuses to render HTML if no sanitizer is configured.
Planned. This page shows the specification from issue #209. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A description column in html mode with the built-in sanitizer. Some rows contain mixed safe and unsafe markup.
Expected behavior
Allowed tags render with formatting. Script, iframe, style, and on* attributes are removed. Selecting 'none' with html mode shows a console warning and falls back to text rendering.
Planned API surface
columns[].renderModesanitizersanitizerConfig.allowedTagssanitizerConfig.allowedAttributesonSanitizedAcceptance criteria
- html mode without a sanitizer renders as text and emits a single dev warning. (pending)
- The built-in sanitizer removes all on* attributes and javascript: URLs. (pending)
- onSanitized fires with counts of removed nodes and attributes. (pending)
- Changing allowedTags re-renders affected cells only. (pending)