cofoundry
cofoundry copied to clipboard
HTML Editor: Relax default TinyMCE ValidElements config
The default TinyMCE valid elements configuration is very strict and can cause unexpected conversion of html, this is particularly relevant for the built-in RawHtml module which actually transforms a lot of html code. See #202 for an example, but another example is inserting an embeded tweet.
The TinyMCE setup can be configured but perhaps the default should be more lenient. Some other things to consider:
- The RawHtml block type isn't actually very good with raw html because of the TinyMCE validation and our html sanitization. Perhaps this should be renamed, or perhaps is should be removed altogether, since outputting raw html without sanitization is something that (although occasionally needed) shouldn't be recommended by default.
- Should the HTML Editor be a separate plugin? Although the attributes would be good to include in core, the actual editor choice is perhaps something better left to a plugin (in a similar way for image resizing). I think we may want to offer flexibility here to use different editors, especially if a more modern or better suited one become available, or if a paid-for-licence editor such as CKEditor is preferable. Also like image resizing, this could be a confusing move, as many would expect an html editor to be bundled. A default Cofoundry meta package or template would aleviate this issue.