I have spent 2 days on google but have not been able to find a working answer for V4 of TinyMCE.
I am using the latest CDN version of TinyMCE in my project and i am after a way to not only paste as plain text but to remove everything except minor things like <p>
and <br/>
. I have a problem with pasting in items and bringing baggage like <div>
.
The current working version is based of this answer https://stackoverflow.com/a/9050597/1917125.
<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script>
tinymce.init({ plugins : 'paste',
paste_auto_cleanup_on_paste : true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,
selector:'input#tinymce',
height: 400,
menubar : false,
toolbar: "undo redo | bold italic |
alignleft aligncenter alignright alignjustify |
bullist numlist outdent indent "});
</script>
This works in removing all visual elements, but i need to do one better and remove elements like <div>
from a CTRL-V
paste.
Thanks in advance.