refactoring

This commit is contained in:
Philipp Kühn
2021-01-15 15:58:39 +01:00
parent decabc09c6
commit 9f0ae94201
2 changed files with 41 additions and 19 deletions

View File

@@ -1,9 +1,17 @@
import { Node } from '@tiptap/core'
import Suggestion from '@tiptap/suggestion'
export interface MentionOptions {
renderer: any,
}
export const Mention = Node.create({
name: 'mention',
defaultOptions: <MentionOptions>{
renderer: null,
},
group: 'inline',
inline: true,
@@ -37,7 +45,11 @@ export const Mention = Node.create({
addProseMirrorPlugins() {
return [
Suggestion({}),
Suggestion({
editor: this.editor,
char: '@',
renderer: this.options.renderer,
}),
]
},
})