From d4746d67e6cc6f8332809a438a44e50a835d1fbc Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 1 Sep 2022 12:21:50 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/5775 --- app/src/editor/index.ts | 4 ++-- app/src/protyle/util/Options.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/editor/index.ts b/app/src/editor/index.ts index f763b9121..3f1518e27 100644 --- a/app/src/editor/index.ts +++ b/app/src/editor/index.ts @@ -28,14 +28,14 @@ export class Editor extends Model { this.initProtyle(options); } - private initProtyle(options: { + private initProtyle(options: { blockId: string, action?: string[] mode?: TEditorMode, scrollAttr?: IScrollAttr }) { this.editor = new Protyle(this.element, { - action: options.action, + action: options.action || [], blockId: options.blockId, mode: options.mode, render: { diff --git a/app/src/protyle/util/Options.ts b/app/src/protyle/util/Options.ts index 9ab6c0ae0..c97208f8c 100644 --- a/app/src/protyle/util/Options.ts +++ b/app/src/protyle/util/Options.ts @@ -121,7 +121,7 @@ export class Options { filename: (name: string) => name.replace(/[\\/:*?"'<>|]/g, ""), linkToImgUrl: "", withCredentials: false, - }, + } }; constructor(options: IOptions) {