View Full Version : WYSIWYG Editor Maintain Formatting
bluewalrus
12-01-2010, 03:47 PM
Does anyone know of a wysiwyg editor that maintains the formatting of pasted text (e.g. from word)? It'd also be nice if it could handle images.
I've tried ckeditor, nicedit, and tinymce. All of these though I've run into some flaws with.
Thanks.
djr33
12-01-2010, 05:24 PM
All of them are bound to have some flaws, but do you mean specifically flaws with pasting formatted text? Did any of them work at all?
One that I used to use (no need at the moment) is http://www.openwebware.com/ and it doesn't seem to allow pasting formatted text either.
My guess is that it is not possible because stripping the formatting is probably at the program level (browser) and even if not, you'd need to write a javascript parser for formatted clipboard data and that might be very complex. Directly placing it in a text box would be a different format than html and probably just display as text (strange looking characters).
Of course if you have html, you can paste that as source code (at least in some of them) but that's not too helpful for what you're describing.
bluewalrus
12-01-2010, 05:52 PM
The ckeditor worked well for the pasting but some of the described functions don't work, the documentation on them is pretty limited, and the forums aren't very active.
djr33
12-01-2010, 06:00 PM
At least that's encouraging, since you now know that it's possible.
I'd recommend investigating why it works in that and trying to maybe adapt its code to work with the others (if the license permits it) or build your own. None of that sounds fun, though.
Beverleyh
12-01-2010, 06:12 PM
I've used a plugin called "codeprotect" with TinyMCE and that allows custom scrips/formatting/code to remain untouched on-save (TinyMCE doesn't strip it). Maybe that might work for you here?
bluewalrus
12-02-2010, 04:13 PM
Yea, I tried tinymce and they do have some nice features I hadn't seen before but I don't like that it changes your code. The first example of this I noticed was the start tag of ol's it just completely removes it.
I'm going to try and mash up nicedit and ckeditor I think. I've started a thread in the javascript forum if anyone is interested in this http://www.dynamicdrive.com/forums/showthread.php?p=242743
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.