Opened 10 years ago
Last modified 8 years ago
#13148 confirmed Bug
Pate from Word empty list issue
Reported by: | Karen Ananiev | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Plugin : Paste from Word | Version: | 3.0 |
Keywords: | Cc: |
Description
If there is empty list in pasted from Word data CKEditor will show an alert "It was not possible to clean up the pasted data due to an internal error".
The simplest way to reproduce it is edit /plugins/pastefromword/filter/default.js file. Find the following code:
try { data = dataProcessor.toHtml( data ); } catch ( e ) { alert( editor.lang.pastefromword.error ); }
and override the data var above it:
data = '<div>Test paste empty list from Word <ul><li></li></ul></div>'; try { data = dataProcessor.toHtml( data ); } catch ( e ) { alert( editor.lang.pastefromword.error ); }
Open editor, click Paste from Word button type anything and click OK.
Change History (8)
comment:1 Changed 10 years ago by
Component: | General → Plugin : Paste from Word |
---|
comment:2 Changed 10 years ago by
Status: | new → confirmed |
---|---|
Version: | → 3.0 |
comment:3 Changed 10 years ago by
@j.swiderski Yes, we encountered with this issue on copy/pasting certain docx document only on OSX (Chrome/Safari). Here is the doc: https://drive.google.com/open?id=0B7Kjm0OlbKz8WnBLcXFESFJWQWs&authuser=0
comment:4 Changed 10 years ago by
@karena I have tried your document on Full package Demo but no errors occur. Were you able to reproduce this problem in our demo page or standalone, default CKEditor? I'm asking this just because perhaps there is some modification made to your editor that influences this behaviour.
Although passing such HTML to the filter is still questionable, I think it is worth checking this issue because exception being thrown during document processing is never a good thing.
comment:5 Changed 10 years ago by
@j.swiderski I was able to reproduce this issue on demo page. We have various modifications but we did not touch Paste from Word feature. Here is the video I hope it will be helpful http://www.screencast.com/t/hiZylQqZ
Thank you!
comment:6 Changed 10 years ago by
I have finally managed to reproduce this issue by pasting this text into Firefox on MAC.
comment:8 Changed 8 years ago by
Milestone: | CKEditor 4.6.0 |
---|
We're unable to put any more PFW related tickets in 4.6.0. We'll revisit it later.
The error is Cannot read property 'name' of undefined" and is first thrown in writeHtml for fragment.js -
fragment.writeHtml( writer, this.dataFilter );
and if I checked correctly it is further thrown in filter.js exec method in linie 335ret = rule.value.apply( null, args );
@karena; I have tried pasting empty lists from word but that seems to work fine. I agree that error should not be thrown but the TC you have provided is let's say weird. Is there any real life scenario (perhaps appropriate word document) which ends up with that error?
Problem can be reproduced from CKEditor 3.x.