Ticket #3046: 3046.patch

File 3046.patch, 1.6 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/list/plugin.js

     
    121121                                                                && currentListItem.getLast().type == CKEDITOR.NODE_ELEMENT
    122122                                                                && currentListItem.getLast().getAttribute( 'type' ) == '_moz' )
    123123                                                        currentListItem.getLast().remove();
    124                                                 currentListItem.append( doc.createElement( 'br' ) );
     124                                                currentListItem.appendBogusBr();
    125125                                        }
    126126
    127127                                        if ( currentListItem.getName() == paragraphMode && currentListItem.$.firstChild )
     
    138138
    139139                                        var currentListItemName = currentListItem.$.nodeName.toLowerCase();
    140140                                        if ( !CKEDITOR.env.ie && currentListItemName == 'div' || currentListItemName == 'p' )
    141                                                 currentListItem.append( doc.createElement( 'br' ) );
     141                                                currentListItem.appendBogusBr();
    142142                                        retval.append( currentListItem );
    143143                                        rootNode = null;
    144144                                        currentIndex++;
  • _source/core/dom/element.js

     
    12071207                                        this.removeClass( 'cke_disabled' );
    12081208                                        break;
    12091209                        }
     1210                },
     1211
     1212                appendBogusBr : function()
     1213                {
     1214                        var nodes = this.getElementsByTag( 'br' );
     1215
     1216                        // If there's any BR tag in the block tag, it means the block tag is already
     1217                        // visible, and thus there's no need to expand it.
     1218                        if ( nodes.count() > 0 )
     1219                                return;
     1220
     1221                        this.getDocument().createElement( 'br' ).appendTo( this );
    12101222                }
    12111223        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy