mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
26 lines
578 B
JavaScript
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
|
|
}
|
|
}
|