JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.5
[ckeditor.git] / _source / plugins / bbcode / plugin.js
index fa8bc1a..e403d11 100644 (file)
@@ -566,19 +566,33 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                this.lineBreak( 1 );\r
 \r
                                        this.write( '[', tag );\r
-                                       var option = attributes.option;\r
-                                       option && this.write( '=', option );\r
-                                       this.write( ']' );\r
+                               }\r
+                       },\r
 \r
+                       openTagClose : function( tag )\r
+                       {\r
+\r
+                               if ( tag == 'br' )\r
+                                       this._.output.push( '\n' );\r
+                               else if ( tag in bbcodeMap )\r
+                               {\r
+                                       this.write( ']' );\r
                                        if ( this.getRule( tag, 'breakAfterOpen' ) )\r
                                                this.lineBreak( 1 );\r
                                }\r
-                               else if ( tag == 'br' )\r
-                                       this._.output.push( '\n' );\r
                        },\r
 \r
-                       openTagClose : function() { },\r
-                       attribute : function() { },\r
+                       attribute : function( name, val )\r
+                       {\r
+                               if ( name == 'option' )\r
+                               {\r
+                                       // Force simply ampersand in attributes.\r
+                                       if ( typeof val == 'string' )\r
+                                               val = val.replace( /&/g, '&' );\r
+\r
+                                       this.write( '=', val );\r
+                               }\r
+                       },\r
 \r
                        closeTag : function( tag )\r
                        {\r