X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fbbcode%2Fplugin.js;h=e403d1113c78695c2893b7c257f7b19e15599e1d;hp=fa8bc1a9ffd67f8f5fcb6601ebc79ba5ccf73966;hb=fb481ba0a7d298e3e7b9034fcb9f2afdc6e8e796;hpb=6e682412d5cc0dfaedb376482e585bf2989c6863 diff --git a/_source/plugins/bbcode/plugin.js b/_source/plugins/bbcode/plugin.js index fa8bc1a..e403d11 100644 --- a/_source/plugins/bbcode/plugin.js +++ b/_source/plugins/bbcode/plugin.js @@ -566,19 +566,33 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.lineBreak( 1 ); this.write( '[', tag ); - var option = attributes.option; - option && this.write( '=', option ); - this.write( ']' ); + } + }, + openTagClose : function( tag ) + { + + if ( tag == 'br' ) + this._.output.push( '\n' ); + else if ( tag in bbcodeMap ) + { + this.write( ']' ); if ( this.getRule( tag, 'breakAfterOpen' ) ) this.lineBreak( 1 ); } - else if ( tag == 'br' ) - this._.output.push( '\n' ); }, - openTagClose : function() { }, - attribute : function() { }, + attribute : function( name, val ) + { + if ( name == 'option' ) + { + // Force simply ampersand in attributes. + if ( typeof val == 'string' ) + val = val.replace( /&/g, '&' ); + + this.write( '=', val ); + } + }, closeTag : function( tag ) {