Create dedicated file for syntax highlight

This commit is contained in:
Elian Doran
2024-10-26 23:14:51 +03:00
parent c81b847b61
commit bf28005f46
2 changed files with 5 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
export function initSyntaxHighlighting() {
console.log("Init syntax highlight");
}

View File

@@ -10,6 +10,7 @@ import AbstractTextTypeWidget from "./abstract_text_type_widget.js";
import link from "../../services/link.js";
import appContext from "../../components/app_context.js";
import dialogService from "../../services/dialog.js";
import { initSyntaxHighlighting } from "./ckeditor/syntax_highlight.js";
const ENABLE_INSPECTOR = false;
@@ -157,6 +158,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
this.watchdog.setCreator(async (elementOrData, editorConfig) => {
const editor = await BalloonEditor.create(elementOrData, editorConfig);
initSyntaxHighlighting();
editor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate());