Here's a link https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/installing-plugins.html您应该了解如何向 ckeditor 添加插件。
TL;DR:您应该创建一个包含您的插件(在您的情况下为 MathType 插件)的新版本,最简单的方法是使用他们的在线构建器 https://ckeditor.com/ckeditor-5/online-builder/,那么您可以使用您生成的构建而不是@ckeditor/ckeditor5-build-classic
例如。
我已经完成了这项工作并将其发布到 npm,你可以使用以下命令安装它:
npm install ckeditor5-classic-with-mathtype
这是将其与 React 一起使用的示例:
import CKEditor from '@ckeditor/ckeditor5-react';
import ClassicEditor from 'ckeditor5-classic-with-mathtype';
...
render() {
return (
<CKEditor
editor={ClassicEditor}
config={{
toolbar: {
items: [
'heading', 'MathType', 'ChemType',
'|',
'bold',
'italic',
'link',
'bulletedList',
'numberedList',
'imageUpload',
'mediaEmbed',
'insertTable',
'blockQuote',
'undo',
'redo'
]
},
}}
data="<p>Hello from CKEditor 5 with MathType!</p>"
onInit={editor => {
// You can store the "editor" and use when it is needed.
// console.log( 'Editor is ready to use!', editor );
}}
/>
);
}