Three dominant themes in the discussion
| Theme | Key points | Representative quotes |
|---|---|---|
| 1. Safety & the ambiguity of “safe” sanitization | Developers worry that the new API mixes “safe” and “unsafe” methods, that the term safe is vague, and that the default configuration still allows markup that could be abused. | • entuno: “This kind of thing always makes me nervous… it’s not at all clear which is which from the names.” • jncraton: “You are right that the concept of ‘safe’ is nebulous, but the goal here is specifically to be XSS‑safe.” • embedding‑shape: “How exactly, given that setHTML sanitizes the input? If you don’t want any HTML tags, can you configure that?” |
| 2. Tooling, adoption, and browser support | The community discusses how to adopt the API—via linters, polyfills, or AI‑assisted refactoring—and notes that widespread browser support is still pending. | • thenewnewguy: “If you want to adopt this in your project, you can add a linter that explicitly bans innerHTML.” • simonw: “It looks like it will be a while before browser support is widely distributed enough to rely on it.” • noduerme: “Some sanitization is better than none? If you’re relying on the browser to handle it for you, you’re already in a lot of trouble.” |
| 3. Practical use cases & trade‑offs | Users weigh the benefits of allowing limited markup (e.g., markdown) against the risk of footguns and the fact that the API still permits arbitrary non‑script tags. | • cogman10: “The main case I can think of is wanting some forum functionality… you could take the HTML generated from the markdown and further lock it down.” • Aachen: “Preventing one bug class (script execution) is good, but this still allows arbitrary markup to the page (even <style> rules).” • cogman10: “Seems like this has a bunch of footguns… especially if you use the ‘remove’ sanitizer API.” |
These themes capture the community’s concerns about safety, the practical steps needed for adoption, and the real‑world trade‑offs developers face when moving from innerHTML to the new sanitization API.