Skip to content

Commit 1acc302

Browse files
committed
fix: show registering the plugins
1 parent 7f448e5 commit 1acc302

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,17 @@ export class BlockNoteEditor<
10621062
* @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
10631063
*/
10641064
public mount = (element: HTMLElement) => {
1065+
const extensions = this._extensionManager.getExtensions().values();
1066+
// TODO can do something similar for input rules
1067+
// extensions.filter(e => e.instance.inputRules)
1068+
1069+
const state = this._tiptapEditor.state.reconfigure({
1070+
plugins: this._tiptapEditor.state.plugins.concat(
1071+
extensions.flatMap((e) => e.instance.plugins ?? []).toArray(),
1072+
),
1073+
});
1074+
this._tiptapEditor.view.updateState(state);
1075+
10651076
// TODO: Fix typing for this in a TipTap PR
10661077
this._tiptapEditor.mount({ mount: element } as any);
10671078
};

packages/core/src/editor/managers/ExtensionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ExtensionManager {
5050
* Get all extensions
5151
*/
5252
public getExtensions() {
53-
return this.editor.extensions;
53+
return this.extensions;
5454
}
5555

5656
/**

0 commit comments

Comments
 (0)