Ticket #3441: 3441_2.patch

File 3441_2.patch, 2.0 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/entities/plugin.js

     
    135135
    136136                                htmlFilter.addRules(
    137137                                        {
    138                                                 text : function( text )
     138                                                text : function( text , tagName )
    139139                                                {
    140                                                         return text.replace( entitiesRegex, getChar );
     140                                                        // Ignore encode script/style tag contents.
     141                                                        return !( tagName == 'script' || tagName == 'style' ) ?
     142                                                                text.replace( entitiesRegex, getChar ) : text;
    141143                                                }
    142144                                        });
    143145                        }
  • _source/core/htmlparser/text.js

     
    1212         * @constructor
    1313         * @example
    1414         */
    15         CKEDITOR.htmlParser.text = function( value )
     15        CKEDITOR.htmlParser.text = function( value )
    1616        {
    1717                /**
    1818                 * The text value.
     
    4646                {
    4747                        var text = this.value;
    4848
    49                         if ( filter && !( text = filter.onText( text ) ) )
     49                        if ( filter && !( text = filter.onText( text , this.parent ) ) )
    5050                                return;
    5151
    5252                        writer.text( text );
  • _source/core/htmlparser/filter.js

     
    5656                        {
    5757                                return filterName( name, this._.attributeNames );
    5858                        },
    59 
    60                         onText : function( text )
     59                       
     60                        /**
     61                         * Filtering text node content.
     62                         * @param {Object} text The text content.
     63                         * @param {CKEDITOR.htmlParser.element} element The context element.
     64                         */
     65                        onText : function( text , element )
    6166                        {
    6267                                var textFilter = this._.text;
    63                                 return textFilter ? textFilter.filter( text ) : text;
     68                                return textFilter ? textFilter.filter( text , element.name ) : text;
    6469                        },
    6570
    6671                        onComment : function( commentText )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy