2019-04-17 00:08:21 +02:00

26 lines
578 B
JavaScript

import { Node } from 'tiptap'
import { replaceText } from 'tiptap-commands'
import { Mention as TipTapMention } from 'tiptap-extensions'
export default class Mention extends TipTapMention {
get schema() {
const schema = super.schema
schema.attrs = {
url: {},
label: {},
},
schema.toDOM = node => [
'a',
{
class: this.options.mentionClass,
href: node.attrs.url,
},
`${this.options.matcher.char}${node.attrs.label}`
]
schema.parseDOM = [
// this is not implemented
]
return schema
}
}