In the past I have been using tinyMCE for my various projects. It actually works fine, except when users paste content from Word, which adds all sorts of horrible tags. (We all know this)
I see that your editor has a 'Paste From Word' button, that pops up a dialog with a plain text box, and then adds the stripped content into your editor. This is well and good, and even seems to work, but I have found that if I just paste directly into the WYM textarea, save my edit, and try to load it up again, it crashes the Javascript, and just loads a plain text box, showing all that horrible Word markup.
I understand that the users shouldn't do this, but my users are real actual people, and they will do this.
Wouldn't it be possible to detect if what was being pasted already had formating, and to remove it? In anycase, allowing bad data to crash the JavaScript is not working for me. Perhaps I am doing it wrong?
My Code (PHP):
- Code: Select all
<script type="text/javascript">
jQuery(function() {
jQuery('.wymeditor').wymeditor({
html: '<? echo $description;?>',
stylesheet: 'styles.css'
});
});
</script>