wip: add extension.name
This commit is contained in:
@@ -292,26 +292,29 @@ declare module '@tiptap/core' {
|
||||
}
|
||||
|
||||
export class Mark<Options = any> {
|
||||
type = 'node'
|
||||
type = 'mark'
|
||||
|
||||
config: MarkConfig = {
|
||||
name: 'node',
|
||||
priority: 100,
|
||||
defaultOptions: {},
|
||||
}
|
||||
|
||||
options: Options
|
||||
name = 'mark'
|
||||
|
||||
parent: Mark | null = null
|
||||
|
||||
child: Mark | null = null
|
||||
|
||||
options: Options
|
||||
|
||||
config: MarkConfig = {
|
||||
name: this.name,
|
||||
priority: 100,
|
||||
defaultOptions: {},
|
||||
}
|
||||
|
||||
constructor(config: Partial<MarkConfig<Options>> = {}) {
|
||||
this.config = {
|
||||
...this.config,
|
||||
...config,
|
||||
}
|
||||
|
||||
this.name = this.config.name
|
||||
this.options = this.config.defaultOptions
|
||||
}
|
||||
|
||||
@@ -332,6 +335,10 @@ export class Mark<Options = any> {
|
||||
|
||||
this.child = extension
|
||||
|
||||
extension.name = extendedConfig.name
|
||||
? extendedConfig.name
|
||||
: this.name
|
||||
|
||||
extension.options = {
|
||||
...extension.parent.options,
|
||||
...extension.options,
|
||||
|
||||
Reference in New Issue
Block a user