You might find that you need to allow some HTML5 elements in your TinyMCE editor, but by default it does not allow any of these new elements. Now, you are probably not going to want to be allowing editors to add elements like header,footer,section - these should probably be controlled in your template/snippet/chunks, but some elements it is nice to add this feature in. For instance, I wanted to be able to allow the figure and figcaption elements to be used to wrap images. Note: this is only possible if you use HTML mode, this is not an automatically added tag.
Locate the config file for TinyMCE, and update the mce_extended_valid_elements
variable to include the elements you need.
The config file is located:
In Evo: 'assets/plugins/tinymce/js/xconfig.js'
In Revo: 'assets/components/tinymce/xconfig.js'
You add the name of the element, plus any attributes that should be allowed. Multiple elements are added separated by a comma. Details on how to add elements are here.
var mce_extended_valid_elements = "figure[class],figcaption";
It can be also helpful to refer to the docs for the standard valid_elements, as this describes how the rules are applied in more detail:
Also, if you are having trouble getting this to work, check you have emptied your browser cache since making the change.
[ed. note: christianhanvey last edited this post 7 years, 5 months ago.]