Editor refactor: extract system stuff

This commit is contained in:
Zef Hemel
2023-07-14 13:44:30 +02:00
parent 87b0e7e352
commit b39a9b8e22
8 changed files with 240 additions and 190 deletions
+2 -1
View File
@@ -103,7 +103,8 @@ export function fencedCodePlugin(editor: Editor) {
if (isCursorInRange(state, [from, to])) return;
const text = state.sliceDoc(from, to);
const [_, lang] = text.match(/^```(\w+)?/)!;
const codeWidgetCallback = editor.codeWidgetHook.codeWidgetCallbacks
const codeWidgetCallback = editor.system.codeWidgetHook
.codeWidgetCallbacks
.get(lang);
if (codeWidgetCallback) {
// We got a custom renderer!