I'm wondering if it's possible to exclude some elements from TinyMCE's editable DIV. Here's an example code:
<div class="editable-area">
<h2>heading</h2>
<p>paragraph</p>
<div class="exclude-this-element"></div>
</div>
.exclude-this-element:empty:before { content: "Editable Area"; }
tinymce.init({
inline: true,
fixed_toolbar_container: '.toolbar'
});
tinyMCE.execCommand('mceAddEditor', false, '.editable-area');
The problem is that, when TinyMCE is initialized on .editable-area
, it adds <br>
tag to .exclude-this-element
and Editable Area
text stops appearing. Actually, I think that entire .exclude-this-element
is erased after a while. Can this element be excluded completely from being altered by TinyMCE?
I would also like to attach some actions (like click
or jQuery UI functions) to .exclude-this-element
and make it not interfere with TinyMCE.
I tried valid_children
, valid_elements
and invalid_elements
but I think that none of these can be used to exclude any elements from being editable (it only excludes them when saving the content of the editor): http://www.tinymce.com/wiki.php/Configuration