Skip to content

Commit f53faa1

Browse files
authored
fix: disableExtensions
1 parent 82c463f commit f53faa1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ export class BlockNoteEditor<
474474
return ext;
475475
}
476476

477+
if (!ext.plugin) {
478+
throw new Error(
479+
"Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property"
480+
);
481+
}
482+
477483
// "blocknote" extensions (prosemirror plugins)
478484
return Extension.create({
479485
name: key,

packages/core/src/editor/BlockNoteExtensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const getBlockNoteExtensions = <
116116
ret["nodeSelectionKeyboard"] = new NodeSelectionKeyboardPlugin();
117117

118118
const disableExtensions: string[] = opts.disableExtensions || [];
119-
for (const ext of Object.keys(disableExtensions)) {
119+
for (const ext of disableExtensions) {
120120
delete ret[ext];
121121
}
122122

0 commit comments

Comments
 (0)