Ticket #7870: 7870.patch

File 7870.patch, 1.9 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/bbcode/plugin.js

     
    557557                                if ( tag in bbcodeMap )
    558558                                {
    559559                                        if ( this.getRule( tag, 'breakBeforeOpen' ) )
    560                                                 this.lineBreak( 1 );
     560                                                this.lineBreak();
    561561
    562562                                        this.write( '[', tag );
    563563                                        var option = attributes.option;
     
    565565                                        this.write( ']' );
    566566
    567567                                        if ( this.getRule( tag, 'breakAfterOpen' ) )
    568                                                 this.lineBreak( 1 );
     568                                                this.lineBreak();
    569569                                }
    570570                                else if ( tag == 'br' )
    571571                                        this._.output.push( '\n' );
     572                                else if ( tag == 'block' )
     573                                        this.lineBreak();
    572574                        },
    573575
    574576                        openTagClose : function() { },
     
    579581                                if ( tag in bbcodeMap )
    580582                                {
    581583                                        if ( this.getRule( tag, 'breakBeforeClose' ) )
    582                                                 this.lineBreak( 1 );
     584                                                this.lineBreak();
    583585
    584586                                        tag != '*' && this.write( '[/', tag, ']' );
    585587
    586588                                        if ( this.getRule( tag, 'breakAfterClose' ) )
    587                                                 this.lineBreak( 1 );
     589                                                this.lineBreak();
    588590                                }
     591                                else if ( tag == 'block' )
     592                                        this.lineBreak();
    589593                        },
    590594
    591595                        text : function( text )
     
    603607                        comment : function() {},
    604608
    605609                        /*
    606                         * Output line-break for formatting.
     610                        * Output a soft line-break for formatting, it only introduces
     611                        * real line-break only when there's no existence.
    607612                         */
    608613                        lineBreak : function()
    609614                        {
     
    852857                                                        else
    853858                                                                element.children = [ new CKEDITOR.htmlParser.text( src ) ];
    854859                                                }
     860                                                // "block" is just a formatting element lives outside of bbcode map,
     861                                                // whose tag name will not be outputted, just wraps content with line-breaks. (#7870)
     862                                                else if ( tagName in CKEDITOR.dtd.$block )
     863                                                        tagName = 'block';
    855864
    856865                                                element.name = tagName;
    857866                                                value && ( element.attributes.option = value );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy