Changes between Initial Version and Version 1 of Ticket #10672, comment 2


Ignore:
Timestamp:
Jul 25, 2013, 6:27:15 PM (12 years ago)
Author:
kevin
Comment:

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 created an error in the default.js script that resulted in a correctly formatted list. I will try to explain below.
     1The 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.
    22
    33I 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).
     
    2323}}}
    2424
    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.
     25Commenting out line 1150 subsequently resulted in a valid list. To recreate simply comment out line 1150
    2726
    2827Line 119 in pastefromword/filter/default.js
    2928{{{
    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
    3633}}}
    3734
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy