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