some html no longer works (iframes for instance)
Closed this issue · 1 comments
Previously in the 1.x version, I could pass html content and wysiwyg-e would render it. Now it seems I can only basic html such as images, links, headers, etc. I need to be able to have iframes as well. I think this might have been sanitized with the 2.x versions. Is there any way to get this functionality back?
By default, the editor only allows tags that it uses internally. Then, tools add to the allowed tags list based on what they use internally (i.e. the image tool adds 'img' to the allowed tags list). If you need to be able to configure the iframe, I'd suggest a custom tool. If no configuration is needed, then you can just add 'iframe' to the editor's allowedTagNames
property.
For a basic example with only one editor:
document.querySelector('wysiwyg-e').allowedTagNames.push('iframe');
You'll need to do the above before loading content.