Ticket #3257: 3257_2.patch

File 3257_2.patch, 1.0 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/list/plugin.js

     
    234234                newList.listNode.replace( groupObj.root );
    235235        }
    236236
     237        var headerTagRegex = /^h[1-6]$/;
     238
    237239        function createList( editor, groupObj, listsCreated )
    238240        {
    239241                var contents = groupObj.contents,
     
    285287                {
    286288                        var contentBlock = listContents.shift(),
    287289                                listItem = doc.createElement( 'li' );
    288                         contentBlock.moveChildren( listItem );
    289                         contentBlock.remove();
     290
     291                        // Preserve heading structure when converting to list item. (#5271)
     292                        if ( headerTagRegex.test( contentBlock.getName() ) )
     293                                contentBlock.appendTo( listItem );
     294                        else
     295                        {
     296                                contentBlock.copyAttributes( listItem );
     297                                contentBlock.moveChildren( listItem );
     298                                contentBlock.remove();
     299                        }
     300
    290301                        listItem.appendTo( listNode );
    291302
    292303                        // Append a bogus BR to force the LI to render at full height
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy