const sanitizer = new Sanitizer({ elements: ["span"] });
sanitizer.allowElement("b");Sanitizer: allowElement() method / notebook
Sanitizer: allowElement() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const sanitizer = new Sanitizer({ elements: ["span"] });
sanitizer.allowElement({
name: "div",
attributes: ["class"],
removeAttributes: ["lang"],
});