2 ms·
There is also a future way of doing this with vanilla JavaScript using the Sanitize API. It is enabled under flags in most browsers currently. https://develope
by runarberg 3y ago
There is also a future way of doing this with vanilla JavaScript using the Sanitize API. It is enabled under flags in most browsers currently.
https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API https://developer.mozilla.org/en-US/docs/Web/API/HTML_Saniti...
- panzi 3y agoYes, that one seems promising, but I really would like more control on allowed URLs. I.e. a flag to allow/disallow cross domain URLs anywhere (<a href>, <link href>, <form action>, <img src>, <img srcset>, <iframe src> etc. etc.) And does it strip any styles (style attribute, style tag, link stylesheet)? If yes, can I allow certain styles somehow? Needs work IMO.