validate_html
Pre-flight check on html / css / js BEFORE writing via update_html. Returns { ok, errors, warnings, parsed } where parsed has byte counts per field and htmlDropped (true if the sanitizer would strip anything from html) plus htmlRemoved, the list of tags ({ tag, count }) and attributes ({ tag, attribute, count }) it would remove (capped at 25; htmlRemovedTruncated flags the cut). The same list appears in the html_sanitized warning. Errors cover cap breaches (html_too_large, css_too_large, js_too_large, total_too_large) and sanitizer rejection (html_sanitize_rejected, html_sanitize_empty). The sanitizer keeps <script> and <link>, but scripts do not run in html surfaces today (inline <script> and the js field are stored, never executed), so a passing check does not mean script-driven content will work: build static HTML/SVG/CSS. <canvas> and data-* attributes are kept. Still stripped: any tag or attribute off the allowlist — e.g. <iframe>, <object>, <embed>, <meta>, custom elements, inline on*= attributes, javascript:/data:text/html URIs. Read htmlRemoved rather than guessing. NEVER writes anything. Use when iterating on a payload so you don't burn a write on something the surface would reject.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | No | JS to validate (optional). | |
| css | No | CSS to validate (optional). | |
| html | No | HTML to validate (optional). |