From c897cc158237c69f8eeceebdfa7c7c4e2ec360aa Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:51:38 -0700 Subject: [PATCH] Desktop: Update plugin compatibility layer to allow more legacy plugins (e.g. Markdown Prettier) to run (#11033) --- .../CodeMirror/CodeMirror5Emulation/CodeMirror5Emulation.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/editor/CodeMirror/CodeMirror5Emulation/CodeMirror5Emulation.ts b/packages/editor/CodeMirror/CodeMirror5Emulation/CodeMirror5Emulation.ts index 7a9d5a1c9..7e57e3533 100644 --- a/packages/editor/CodeMirror/CodeMirror5Emulation/CodeMirror5Emulation.ts +++ b/packages/editor/CodeMirror/CodeMirror5Emulation/CodeMirror5Emulation.ts @@ -426,6 +426,12 @@ export default class CodeMirror5Emulation extends BaseCodeMirror5Emulation { ); } + public getDoc() { + // The emulation layer has several of the methods available on a CodeMirror 5 document. + // For some plugins, `this` is sufficient. + return this; + } + public static commands = (() => { const commands: Record = { ...BaseCodeMirror5Emulation.commands,