Ticket #3933: 3933.patch

File 3933.patch, 1.4 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    212212                if ( lastNode && lastNode.getName && ( lastNode.getName() in nonExitableElementNames ) )
    213213                {
    214214                        restoreDirty( editor );
    215                         var paddingBlock = editor.document.createElement(
    216                                         ( CKEDITOR.env.ie && enterMode != CKEDITOR.ENTER_BR ) ?
    217                                                 '<br _cke_bogus="true" />' : 'br' );
     215                        var paddingBlock = CKEDITOR.dom.element.createFromHtml( '<br _cke_bogus="true" />' );
    218216                        body.append( paddingBlock );
    219217                }
    220218        }
     
    634632                                        editor.on( 'insertElement', onInsertElement, null, null, 20 );
    635633                                        // Auto fixing on some document structure weakness to enhance usabilities. (#3190 and #3189)
    636634                                        editor.on( 'selectionChange', onSelectionChangeFixBody, null, null, 1 );
     635                                        // Clean up those bogus elements introduced by it on output (#3933).
     636                                        var dataProcessor = editor.dataProcessor,
     637                                                htmlFilter = dataProcessor && dataProcessor.htmlFilter;
     638
     639                                        htmlFilter && htmlFilter.addRules(
     640                                        {
     641                                                elements :
     642                                                {
     643                                                        'br' : function( element )
     644                                                        {
     645                                                                if( element.attributes[ '_cke_bogus' ] )
     646                                                                        return false;
     647                                                        }
     648                                                }
     649                                        }, 5 );
    637650                                });
    638651                }
    639652        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy