fix(core): allow unregistering multiple plugins (#6299)

This commit is contained in:
Nick Perez 2025-04-30 03:01:12 +02:00 committed by bdbch
parent eb4e97d5f2
commit 5de17c52f5
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@tiptap/core": patch
---
Fixes a bug where you could not unregister multiple plugins.

View File

@ -254,7 +254,7 @@ export class Editor extends EventEmitter<EditorEvents> {
const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key
// @ts-ignore // @ts-ignore
plugins = prevPlugins.filter(plugin => !plugin.key.startsWith(name)) plugins = plugins.filter(plugin => !plugin.key.startsWith(name))
}) })
if (prevPlugins.length === plugins.length) { if (prevPlugins.length === plugins.length) {