Changes between Initial Version and Version 1 of Ticket #10672, comment 2
- Timestamp:
- Jul 25, 2013, 6:27:15 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10672, comment 2
initial v1 1 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 c reated an errorin the default.js script that resulted in a correctly formatted list. I will try to explain below.1 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. 2 2 3 3 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). … … 23 23 }}} 24 24 25 By breaking a portion of the clean-up I was able to produce the following error: 26 "It was not possible to clean up the pasted data due to an error". which subsequently resulted in a valid list. To recreate simply add some text (e.g. foobar) to the postProcessList function in the default.js from the plugin folder. In other words the post processing is causing the problem. 25 Commenting out line 1150 subsequently resulted in a valid list. To recreate simply comment out line 1150 27 26 28 27 Line 119 in pastefromword/filter/default.js 29 28 {{{ 30 function postProcessList( list ) { 31 foobar 32 var children = list.children, 33 child, attrs, 34 count = list.children.length, 35 match, mergeStyle, 29 // These rules will have higher priorities than default ones. 30 //comment out below 31 // dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor, dataFilter ) ); 32 36 33 }}} 37 34