2021-05-03 13:48:14 -05:00
|
|
|
import ClassicEditor from "@ckeditor/ckeditor5-editor-classic/src/classiceditor";
|
|
|
|
import Essentials from "@ckeditor/ckeditor5-essentials/src/essentials";
|
|
|
|
import Paragraph from "@ckeditor/ckeditor5-paragraph/src/paragraph";
|
|
|
|
import Bold from "@ckeditor/ckeditor5-basic-styles/src/bold";
|
|
|
|
import Italic from "@ckeditor/ckeditor5-basic-styles/src/italic";
|
2022-08-03 18:18:34 -05:00
|
|
|
import CKEditorInspector from "@ckeditor/ckeditor5-inspector";
|
2021-05-03 13:48:14 -05:00
|
|
|
|
|
|
|
import Math from "../src/math";
|
|
|
|
|
|
|
|
ClassicEditor.create(document.querySelector("#editor"), {
|
|
|
|
plugins: [Essentials, Paragraph, Bold, Italic, Math],
|
|
|
|
toolbar: ["bold", "italic", "math"],
|
2022-08-03 18:18:34 -05:00
|
|
|
math: {
|
|
|
|
engine: "katex",
|
|
|
|
katexRenderOptions: {
|
|
|
|
macros: {
|
|
|
|
"\\test": "\\mathrel{\\char`≠}",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-05-03 13:48:14 -05:00
|
|
|
})
|
|
|
|
.then((editor) => {
|
|
|
|
console.log("Editor was initialized", editor);
|
2022-08-03 18:18:34 -05:00
|
|
|
CKEditorInspector.attach(editor);
|
2021-05-03 13:48:14 -05:00
|
|
|
})
|
|
|
|
.catch((error) => {
|
2021-05-09 22:43:53 -04:00
|
|
|
console.error(error);
|
2021-05-03 13:48:14 -05:00
|
|
|
console.error(error.stack);
|
|
|
|
});
|