angular
angular copied to clipboard
[Question] how i can allow unsafe HTML in the html component
I need to let the html component execute scripts. but i notice that the formio removes my script tags and other unsafe tags like iframe dont work.
Obviously this is on purpose, but it can be overridden with options that get passed to the sanitize methods. Here is the code that shows them.
https://github.com/formio/formio.js/blob/master/src/utils/utils.js#L1046
These options are passed to the DOMPurify library found @ https://github.com/cure53/DOMPurify#can-i-configure-dompurify. They can be passed to the Form.io renderer within Angular like this.
<formio [rendererOptions]="{
sanitizeConfig: {
addTags: ['iframe']
}
}"></formio>