Skip to content

Commit

Permalink
Fix: configured/extended extensions should keep their original config (
Browse files Browse the repository at this point in the history
  • Loading branch information
tleruitte authored Oct 10, 2023
1 parent 6b2edc5 commit fda6310
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class Extension<Options = any, Storage = any> {
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
extendedConfig: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>> = {},
) {
const extension = new Extension<ExtendedOptions, ExtendedStorage>(extendedConfig)
const extension = new Extension<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig })

extension.parent = this

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ export class Mark<Options = any, Storage = any> {
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
extendedConfig: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>> = {},
) {
const extension = new Mark<ExtendedOptions, ExtendedStorage>(extendedConfig)
const extension = new Mark<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig })

extension.parent = this

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ export class Node<Options = any, Storage = any> {
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
extendedConfig: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>> = {},
) {
const extension = new Node<ExtendedOptions, ExtendedStorage>(extendedConfig)
const extension = new Node<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig })

extension.parent = this

Expand Down

0 comments on commit fda6310

Please sign in to comment.