Forum closed. New forum available at http://community.wymeditor.org/

Paste From Word

Support forum for WYMeditor.

Paste From Word

Postby axiomx11 on Tue Jan 15, 2008 4:24 pm

I really like the WYSIWYM approach to rich text editing you guys are doing here.

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>
axiomx11
 
Posts: 1
Joined: Tue Jan 15, 2008 4:13 pm

Re: Paste From Word

Postby brandondurham on Tue Apr 15, 2008 5:44 pm

Instead of inserting the content that way, I've just been putting it directly into the textarea, like this:

Code: Select all
<textarea name="artist" class="wymeditor"><?=$artist?></textarea>
brandondurham
 
Posts: 2
Joined: Tue Apr 15, 2008 5:40 pm

Re: Paste From Word

Postby jfh on Tue Apr 29, 2008 7:48 pm

Hi,

'Crash the JavaScript' - what's the error message? Which browser?
Could you post the content being pasted?

Thanks,
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests