Browse Source

Update src/codeblockcommand.js

Co-Authored-By: Maciej <jodator@jodator.net>
Aleksander Nowodzinski 6 năm trước cách đây
mục cha
commit
7a39a25e4f

+ 1 - 1
packages/ckeditor5-code-block/src/codeblockcommand.js

@@ -46,7 +46,7 @@ export default class CodeBlockCommand extends Command {
 		const editor = this.editor;
 		const editor = this.editor;
 		const model = editor.model;
 		const model = editor.model;
 		const selection = model.document.selection;
 		const selection = model.document.selection;
-		const firstLanguageInConfig = editor.config.get( 'codeBlock' ).languages[ 0 ];
+		const firstLanguageInConfig = editor.config.get( 'codeBlock.languages' ).shift();
 
 
 		const blocks = Array.from( selection.getSelectedBlocks() );
 		const blocks = Array.from( selection.getSelectedBlocks() );
 		const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
 		const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;