X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fbbcode%2Fplugin.js;h=7354fb70b73bde832da038b2c6441568c98a5c66;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=fa8bc1a9ffd67f8f5fcb6601ebc79ba5ccf73966;hpb=2f22c0c38f17e75be5541089076885442aaa2377;p=ckeditor.git diff --git a/_source/plugins/bbcode/plugin.js b/_source/plugins/bbcode/plugin.js index fa8bc1a..7354fb7 100644 --- a/_source/plugins/bbcode/plugin.js +++ b/_source/plugins/bbcode/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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 ) {