Ticket #4746: 4746_2.patch

File 4746_2.patch, 1.8 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/htmldataprocessor/plugin.js

     
    8484        delete blockLikeTags.pre;
    8585        var defaultDataFilterRules =
    8686        {
    87                 elements : {},
     87                elements :
     88                {
     89                        '$' : function( element )
     90                        {
     91                                var attribs = element.attributes;
     92                                // Elements marked as temporary are to be ignored.
     93                                if ( attribs.cke_temp )
     94                                        return false;
     95
     96                                // Elements marked as contextual keep only contents. (#4746)
     97                                if ( attribs.cke_context )
     98                                        delete element.name;
     99
     100                                return element;
     101                        }
     102                },
    88103                attributeNames :
    89104                [
    90105                        // Event attributes (onXYZ) must not be directly set. They can become
  • _source/plugins/wysiwygarea/plugin.js

     
    3232                {
    3333                        this.focus();
    3434
    35                         var selection = this.getSelection();
     35                        var selection = this.getSelection(),
     36                                start = selection.getStartElement(),
     37                                data = evt.data;
     38
    3639                        if ( checkReadOnly( selection ) )
    3740                                return;
    3841
    3942                        var data = evt.data;
    4043                        this.fire( 'saveSnapshot' );
    4144
     45                        // Creating a 'has inline started' parsing context for the inserted HTML,
     46                        // This's because we expect leading spaces are left untouched. (#4767)
     47                        data = '<span cke_temp="1">\ufeff</span>' + data;
     48                        // Creating proper context for insertion happens inside preformatted block.
     49                        if ( start.hasAscendant( 'pre', true ) )
     50                                data = '<pre cke_context="1">' + data + '</pre>';
     51
    4252                        if ( this.dataProcessor )
    4353                                data = this.dataProcessor.toHtml( data );
    4454
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy