fix: fix order of executed plugins, fix #1547
This commit is contained in:
@@ -205,8 +205,12 @@ export default class ExtensionManager {
|
||||
}
|
||||
|
||||
get plugins(): Plugin[] {
|
||||
return [...this.extensions]
|
||||
.reverse()
|
||||
// With ProseMirror, first plugins within an array are executed first.
|
||||
// In tiptap, we provide the ability to override plugins,
|
||||
// so it feels more natural to run plugins at the end of an array first.
|
||||
// That’s why we have to reverse the `extensions` array and sort again
|
||||
// based on the `priority` option.
|
||||
return ExtensionManager.sort([...this.extensions].reverse())
|
||||
.map(extension => {
|
||||
const context = {
|
||||
name: extension.name,
|
||||
|
||||
Reference in New Issue
Block a user