How to Enable Safe HTML
Add the safeHtml property to your unlayer.init() configuration:
unlayer.init({
safeHtml: true
});Once enabled, the editor will automatically sanitize any HTML content added by end-users, removing all JavaScript or unsafe attributes.
When to Use Safe HTML
When allowing end-users to edit or insert custom HTML.
In public-facing or multi-tenant applications.
To prevent accidental or intentional injection of malicious code.
