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) {