#10672 closed Bug (duplicate)
Paste from Word not working properly with lists
Reported by: | kevin | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Plugin : Paste from Word | Version: | 3.6.1 |
Keywords: | Cc: |
Description
When pasting from Word lists are not nested or indented properly after the first indent. This behaviour can be duplicated in Firefox 18, and Chrome 25.0. In IE the results are even worse. The lists are totally messed up, indented or not. See attached screen shots.
Test Platform Windows 7 Word 2010 IE 8 Chrome 25 Firefox 18
Attachments (2)
Change History (8)
Changed 11 years ago by
Attachment: | ckeditor-paste-from-word.jpg added |
---|
comment:1 Changed 11 years ago by
Keywords: | paste word removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
- You have said it yourself "are not nested or indented properly". When you insert invalid code you can expect editor not to present desired result. Because of this I'm closing this ticket as invalid for now.
- Could you please send me Word file that is causing this problem? I will have a look at it and tell if this is a bug after all or not.
comment:2 Changed 11 years ago by
The lists follow proper nesting. Having a list nested within another is perfectly valid. The actual lists coming from the clipboard may not be valid, but one of the objectives of the plugin is to clean-up Word's bad HTML, and it would appear that the plugin is doing this but subsequently breaking the list in the postProcessList function. While doing some troubleshooting I commented out line 1150 -- dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor, dataFilter ) );-- in the default.js script that resulted in a correctly formatted list. I will try to explain below.
I captured the following from the clipboard prior to processing by the plugin. as you can see the parent list item of the sub-list is closed off. Word creates separate lists then indents using a style (style="mso-list:l0 level2).
Partial clipboard data.
</xml><![endif]--> <p class="MsoNormal">Word 2010</p> <ul style="margin-top:0cm" type="disc"> <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Level <span style="mso-spacerun:yes"> </span>1</li> <li class="MsoNormal" style="mso-list:l0 level1 lfo1">Level 1</li> <ul style="margin-top:0cm" type="circle"> <li class="MsoNormal" style="mso-list:l0 level2 lfo1">Level 2</li> <li class="MsoNormal" style="mso-list:l0 level2 lfo1">Level 2</li> </ul><li class="MsoNormal" style="mso-list:l0 level1 lfo1">Level <span style="mso-spacerun:yes"> </span>1</li> <ul style="margin-top:0cm" type="circle"><li class="MsoNormal" style="mso-list:l0 level2 lfo1">Level <span style="mso-spacerun:yes"> </span>2 </li> <li class="MsoNormal" style="mso-list:l0 level2 lfo1">Level<span style="mso-spacerun:yes"> </span>2</li> </ul><li class="MsoNormal" style="mso-list:l0 level1 lfo1">Level 1</li></ul> <!--[if gte mso 9]><xml>
Commenting out line 1150 subsequently resulted in a valid list. To recreate simply comment out line 1150
Line 1150 in pastefromword/filter/default.js
// These rules will have higher priorities than default ones. //comment out below // dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor, dataFilter ) );
Source output after error - note properly nested lists.
<div> <p class="MsoNormal">Word 2010</p> <ul> <li class="MsoNormal">Level 1</li> <li class="MsoNormal">Level 1 <ul> <li class="MsoNormal">Level 2</li> <li class="MsoNormal">Level 2</li> </ul> </li> <li class="MsoNormal">Level 1 <ul> <li class="MsoNormal">Level 2</li> <li class="MsoNormal">Level 2</li> </ul> </li> <li class="MsoNormal">Level 1</li> </ul> </div> <p> </p>
Output without causing error - only first list is indented properly:
<div> <p>Word 2010</p> <ul> <li>Level 1</li> <li>Level 1 <ul> <li>Level 2</li> <li>Level 2</li> </ul> </li> <li>Level 1</li> <li>Level 2</li> <li>Level 2</li> <li>Level 1</li> </ul> </div> <p> </p>
I have attached the Word document for testing. Also note that TinyMCE is able to handle these lists and produce valid html. I will continue troubleshooting as time permits. If I find a solution I will submit as a pull request on Git-Hub.
comment:3 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:4 Changed 11 years ago by
Component: | Core : Pasting → Core : Lists |
---|---|
Resolution: | → duplicate |
Status: | reopened → closed |
Version: | 4.2 → 3.6.1 |
I'm sorry for misunderstanding you in the first place.
Your issue is in fact a duplicate of #8103 and can be reproduced in CKEditor version 3.x as well. I will forward it to my supervisor with question if it can be fixed in one of future releases as it seems important.
@mankev If you have any new findings please add them to #8103.
comment:6 Changed 11 years ago by
Component: | Core : Lists → Plugin : Paste from Word |
---|
paste from word screen shot