Reputation: 556
I'm using CK editor 5 to input some data on our application, and it accepts html in the 'HTML embed' plugin.
On this plugin configuration, we can sanitize the entered data as follows:
htmlEmbed: {
showPreviews: true,
sanitizeHtml: ( inputHtml ) => {
const outputHtml = sanitize( inputHtml );
return {
html: outputHtml,
hasChanged: true
};
}
}
and the sanitize function can be either locally defined or a 3pp, up to the application. This works well when you are previewing the html inside ckeditor, but once you request it the data from the editor, it returns the original html, not the sanitized one.
Is there any way to retrieve the editor value with the sanitized html instead of getting the original one user typed? Sanitizing the entire output is not a option, as I wanna restrict the html tags used in the html editor and they can
Upvotes: -1
Views: 23