Skip to content

Instantly share code, notes, and snippets.

@denielchiang
Last active March 22, 2020 10:09
Show Gist options
  • Save denielchiang/7fc02064c364b90ae807188560f8a5a0 to your computer and use it in GitHub Desktop.
Save denielchiang/7fc02064c364b90ae807188560f8a5a0 to your computer and use it in GitHub Desktop.
Customize CKEdtior
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
// The editor creator to use.
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
import Link from '@ckeditor/ckeditor5-link/src/link';
import List from '@ckeditor/ckeditor5-list/src/list';
import Font from '@ckeditor/ckeditor5-font/src/font';
export default class ClassicEditor extends ClassicEditorBase {}
// Plugins to include in the build.
ClassicEditor.builtinPlugins = [
Essentials,
Bold,
Font,
Indent,
Link,
List
];
// Editor configuration.
ClassicEditor.defaultConfig = {
toolbar: {
items: [
'bold',
'fontColor',
'fontSize',
'link',
'bulletedList',
'numberedList',
'|',
'indent',
'outdent',
'|',
'undo',
'redo'
]
},
// This value must be kept in sync with the language defined in webpack.config.js.
language: 'zh'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment