fix: fix merging options on configure for multiple extension instances
This commit is contained in:
@@ -254,11 +254,13 @@ export class Extension<Options = any> {
|
||||
}
|
||||
|
||||
configure(options: Partial<Options> = {}) {
|
||||
this.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
// return a new instance so we can use the same extension
|
||||
// with different calls of `configure`
|
||||
return this.extend()
|
||||
const extension = this.extend()
|
||||
|
||||
extension.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
return extension
|
||||
}
|
||||
|
||||
extend<ExtendedOptions = Options>(extendedConfig: Partial<ExtensionConfig<ExtendedOptions>> = {}) {
|
||||
|
||||
@@ -351,11 +351,13 @@ export class Mark<Options = any> {
|
||||
}
|
||||
|
||||
configure(options: Partial<Options> = {}) {
|
||||
this.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
// return a new instance so we can use the same extension
|
||||
// with different calls of `configure`
|
||||
return this.extend()
|
||||
const extension = this.extend()
|
||||
|
||||
extension.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
return extension
|
||||
}
|
||||
|
||||
extend<ExtendedOptions = Options>(extendedConfig: Partial<MarkConfig<ExtendedOptions>> = {}) {
|
||||
|
||||
@@ -432,11 +432,13 @@ export class Node<Options = any> {
|
||||
}
|
||||
|
||||
configure(options: Partial<Options> = {}) {
|
||||
this.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
// return a new instance so we can use the same extension
|
||||
// with different calls of `configure`
|
||||
return this.extend()
|
||||
const extension = this.extend()
|
||||
|
||||
extension.options = mergeDeep(this.options, options) as Options
|
||||
|
||||
return extension
|
||||
}
|
||||
|
||||
extend<ExtendedOptions = Options>(extendedConfig: Partial<NodeConfig<ExtendedOptions>> = {}) {
|
||||
|
||||
Reference in New Issue
Block a user