X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fbbcode%2Fplugin.js;h=9ea723213ec886c32f0a40172b83646a1ec04d70;hp=69de69d127b844d91dadbee0fea290a4af37ca1b;hb=refs%2Ftags%2Fv3.6.1;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/bbcode/plugin.js b/_source/plugins/bbcode/plugin.js index 69de69d..9ea7232 100644 --- a/_source/plugins/bbcode/plugin.js +++ b/_source/plugins/bbcode/plugin.js @@ -158,11 +158,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license 4 : close of tag; */ - // Opening tag - if ( ( part = parts[ 1 ] ) ) + part = ( parts[ 1 ] || parts[ 3 ] || '' ).toLowerCase(); + // Unrecognized tags should be delivered as a simple text (#7860). + if ( part && !bbcodeMap[ part ] ) { - part = part.toLowerCase(); + this.onText( parts[ 0 ] ); + continue; + } + // Opening tag + if ( parts[ 1 ] ) + { var tagName = bbcodeMap[ part ], attribs = {}, styles = {}, @@ -201,7 +207,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.onTagOpen( tagName, attribs, CKEDITOR.dtd.$empty[ tagName ] ); } // Closing tag - else if ( ( part = parts[ 3 ] ) ) + else if ( parts[ 3 ] ) this.onTagClose( bbcodeMap[ part ] ); } @@ -872,8 +878,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.dataProcessor.writer = BBCodeWriter; - editor.on( 'editingBlockReady', function () + editor.on( 'beforeSetMode', function( evt ) { + evt.removeListener(); var wysiwyg = editor._.modes[ 'wysiwyg' ]; wysiwyg.loadData = CKEDITOR.tools.override( wysiwyg.loadData, function( org ) {