Opened 11 years ago

Closed 10 years ago

#8925 closed enhancement (fixed)

Copy/Paste from MS Word to dijit.Editor on Firefox3

Reported by: cgierer Owned by:
Priority: high Milestone: 1.5
Component: Editor Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

If you use copy/paste to insert some formatted text from Microsoft Word to a dijit.Editor widget on Firefox 3 (on Windows XP) some additional meta information from Word is pasted (not only HTML content).

Using Firefox 2 only the HTML formatted content is inserted. (see attachments for FF3 and FF2 content).

Other WYSIWYG web editors (like FCKEditor or TinyMCE; see http://forums.mozillazine.org/viewtopic.php?f=38&t=704435&start=0&st=0&sk=t&sd=a) seem to have the same problem and have implemented some special "Paste from Word" functionality to cleanup the content before inserting the content.

dijit.Editor should also provide a similar functionality.

Attachments (2)

ff2_inserted_content.txt (146 bytes) - added by cgierer 11 years ago.
Content inserted to editor widget using Firefox 2
ff3_inserted_content.txt (28.3 KB) - added by cgierer 11 years ago.
Content inserted to editor widget using Firefox 3

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by cgierer

Attachment: ff2_inserted_content.txt added

Content inserted to editor widget using Firefox 2

Changed 11 years ago by cgierer

Attachment: ff3_inserted_content.txt added

Content inserted to editor widget using Firefox 3

comment:1 Changed 11 years ago by Adam Peller

Component: DijitEditor
Owner: set to liucougar
Type: defectenhancement

Sound like a good plugin, possibly for dijit (or for dojox.editor) Is it possible to write a post filter as a plugin? Looks like it would be easy to strip out META tags and those conditional <!-- comments. At least in this example, that would leave one legitimate looking STYLE tag. Do these actually cause any problems besides adding huge amounts of data to the document? Is there anything of value we can extract from them about the clipboard data? It looks largely irrelevant to an external app.

comment:2 Changed 11 years ago by Adam Peller

Oh, I guess it's not really a post filter, but a filter we'd need to establish on the clipboard? Perhaps it's safe to strip these out by default?

comment:3 Changed 11 years ago by Adam Peller

Hmm... not sure what I was thinking. liucougar: it was my understanding that we cannot intercept paste events. Perhaps there is some way we could do this iff the paste button on the toolbar is used? Is that even worth doing if it cannot be applied consistently to the OS-level key accelerators?

comment:4 Changed 11 years ago by liucougar

js has no chance of looking at the os-level clipboard. what we can do is after the content is pasted to the editor, run some code to clean it up

I agree it should be in plugin

comment:5 Changed 11 years ago by Adam Peller

Cougar points out the only way we can likely to this is with a timeout, and only if the paste happens from the toolbar

comment:6 Changed 10 years ago by bill

Milestone: tbdfuture
Owner: liucougar deleted

comment:7 Changed 10 years ago by Jared Jurkiewicz

Milestone: future1.5
Resolution: fixed
Status: newclosed

I have fixed this by adding a plugin for PasteFromWord? in Dojo 1.5 (http://docs.dojocampus.org/dojox/editor/plugins/PasteFromWord)

It resolves the meta information (by stripping it), as well as clean up style applies and such.

Note: See TracTickets for help on using tickets.