Is there a way to get TinyMCE V4 to not remove tags.
tinymce.init({
selector: \'textarea.tinymce\',
theme: \'modern\',
p
TinyMCE will only allow HTML tags where they are valid ... the <style>
tag belongs in the <head>
of the document so if you place one in the <body>
it will strip it out.
If you enable the fullpage
plugin and add a <style>
tag in the <head>
TinyMCE will keep the <style>
tag.
You can use TinyMCE's valid_children
option for that:
valid_children : '+body[style]',
Check this fiddle for a complete example.
The valid_children
enables you to control what child elements can exists within specified parent elements.
Define style
and link
as a custom tag to keep them:
tinymce.init({
...
extended_valid_elements:"style,link[href|rel]",
custom_elements:"style,link,~link"
...
});