Skip to content

Commit

Permalink
Parse plugins array into string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer authored and mlewand committed May 18, 2018
1 parent 97d5c80 commit 3fd65df
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions core/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@

function loadPlugins( editor ) {
var config = editor.config,
// We have to remove whitespaces (#1712).
plugins = config.plugins && config.plugins.replace( /\s/g, '' ) || '',
extraPlugins = config.extraPlugins && config.extraPlugins.replace( /\s/g, '' ),
removePlugins = config.removePlugins && config.removePlugins.replace( /\s/g, '' );
plugins = parsePluginsOption( config.plugins ),
extraPlugins = parsePluginsOption( config.extraPlugins ),
removePlugins = parsePluginsOption( config.removePlugins );

if ( extraPlugins ) {
// Remove them first to avoid duplications.
Expand Down Expand Up @@ -635,6 +634,20 @@
CKEDITOR.fire( 'instanceLoaded', null, editor );
} );
} );

// Parse *plugins option into a string (#1802).
function parsePluginsOption( option ) {
if ( !option ) {
return '';
}

if ( CKEDITOR.tools.isArray( option ) ) {
option = option.join( ',' );
}

// We have to remove whitespaces (#1712).
return option.replace( /\s/g, '' );
}
}

// Send to data output back to editor's associated element.
Expand Down

0 comments on commit 3fd65df

Please sign in to comment.