#10285 closed Bug (fixed)
Styled text pasted from MS Word causes infinite loop
Reported by: | Jakub Ś | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.1.1 |
Component: | Plugin : Paste from Word | Version: | 4.1 |
Keywords: | Cc: |
Description
To reproduce:
- Use below configuration for editor
var editor = CKEDITOR.replace( 'editor1', { pasteFromWordRemoveFontStyles:false, pasteFromWordRemoveStyles : false //,allowedContent: true //This isn't causing any problems } );
- Open page and clear contents with New Page command
- Open attached file and Copy styled text or table with styled text
- Paste it in to editor using Paste From Word dialog or Ctrl+V
Result: CKEditor goes into infinite loop (FF eventually asks if you want to break the script execution).
Problem can be reproduced in all browsers from CKE 4.1 however it looks like ACF is not responsible as setting allowedContent: true
doesn't help to resolve this problem.
Attachments (1)
Change History (15)
Changed 12 years ago by
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 12 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 12 years ago by
I extracted #10327 which fixes one issue in htmlParser.filter. Unfortunately, fixing this issue reveals whole bunch of other in pastefromword filter. I was able to track one of them easily (styleElement in line :603 does not have parent set to element), but I found next inf loop. I don't want to debug it, because it is a waste of time, since we're planning #9991.
I'll try to find hack for this issue.
comment:4 Changed 12 years ago by
Milestone: | → CKEditor 4.1.1 |
---|---|
Status: | assigned → review |
Pushed t/10285 on dev with a hack that prevents from falling in infinite loop.
comment:6 Changed 12 years ago by
For instance, I'm not able to reproduce this issue with Word for Mac 2011.
comment:7 Changed 12 years ago by
Sorry, I forgot to mention that I wasn't able too. Kuba has to sent me HTML generated from his Word. We've got nearly the same version (just last two digits differs) and the same OS, but something was different.
Although try pasting that HTML I posted above and you will blow up editor. There's definitely an issue, I'm sure about that.
comment:8 Changed 12 years ago by
Status: | review → review_passed |
---|
comment:9 Changed 12 years ago by
I confirm that t/10285 fixes inf loop in this case:
<p class="MsoNormal"><span style="font-size:24.0pt">test</span></p>
comment:10 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:3e1df4d on dev and 73f869d on tests.
comment:11 Changed 12 years ago by
I can confirm review_passed. I have tested this issue on all browsers and no infinite loop has occurred.
comment:12 Changed 12 years ago by
I would like to mention that this still occurs. We noticed then when we tried to paste from Outlook to CKEditor.
To reproduce:
1) open any html email in Outlook ( I used 2013 )
2) copy html content, ctrl-a / ctrl-c
3) past content into ckeditor ctrl-v, or click the paste button
The entire browser becomes unresponsive, and has to be killed.
config.fullPage = true # Allow full page HTML config.uiColor = '#f5f5f5' # Match the main site background config.skin = 'moonocolor' # Skins are kept in app/assets/javascripts/ckeditor/skins config.toolbar = ts_inline_toolbar # Base toolbar used on all editors config.enterMode = CKEDITOR.ENTER_BR # Disable wrapping content in <p> elements (needed for inline editing) config.pasteFromWordRemoveFontStyles = false config.autoParagraph = false
comment:13 Changed 12 years ago by
I reported #10498 for this issue, because it's not the same issue if it is Outlook. Could you give us more information in that ticket?
comment:14 Changed 11 years ago by
Component: | General → Plugin : Paste from Word |
---|
I simplified the test case to this HTML:
It completely loops this for loop https://github.com/ckeditor/ckeditor-dev/blob/master/core/htmlparser/fragment.js#L529-L534
I also found that commenting out these two lines stops loop: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/pastefromword/filter/default.js#L938-L939
Although this isn't of course fix for this issue. Now it's time to simplified filter rules in order to be able to track how the inf loop looks like, because it is very complex. By marking filtered nodes I only learnt that element#filterChildren starts processing offline nodes that has to be somewhere created.