Reputation: 101
Trying to paste in some html into the option on the TinyMCE editor that reads as follows:
<textarea onclick="this.focus(); this.select(); _gaq.push(['_trackEvent', 'Infographic', 'Click', 'marketing-infographic']);" rows="2">
<img src="my_image.jpg" width="120" height="136" / >
View full image
<a href="https://site.com/my_image.jpg" />
</textarea>
...when updated, Tiny completely rewrites it to, well, something completely different.
<p>
<img src="my_image.jpg" height="136" width="120" />
<textarea style="height: 44px; width: 300px; margin: 2px;" onclick="this.focus(); this.select(); _gaq.push(['_trackEvent', 'Infographic', 'Click', 'marketing-infographic']);" rows="2">
View full image
</textarea>
<a href="https://site.com/my_image.jpg" title="”Infographic”"> </a>
</p>
I've looked around the forum and here for help, the likes of...
cleanup_on_startup: false,
trim_span_elements: false,
verify_html: false,
cleanup: false,
convert_urls: false
...don't seem to be helping at all. Is there away to allow for this kind of html to be entered via the editor without it getting completely bastardised?
Upvotes: 0
Views: 186
Reputation: 50832
Have a look at the tinymce configuration parameters valid_elements and valid_children and set all relevant html elements and attributes as valid.
Upvotes: 2