mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
parent
1bcef0379f
commit
2390cf20c1
@ -61,7 +61,7 @@ Mention.configure({
|
||||
renderHTML({ options, node }) {
|
||||
return [
|
||||
"a",
|
||||
{ href: '/profile/1' },
|
||||
mergeAttributes({ href: '/profile/1' }, options.HTMLAttributes),
|
||||
`${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`,
|
||||
];
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export const Mention = Node.create<MentionOptions>({
|
||||
renderHTML({ options, node }) {
|
||||
return [
|
||||
'span',
|
||||
this.HTMLAttributes,
|
||||
mergeAttributes(this.HTMLAttributes, options.HTMLAttributes),
|
||||
`${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`,
|
||||
]
|
||||
},
|
||||
@ -131,8 +131,11 @@ export const Mention = Node.create<MentionOptions>({
|
||||
}),
|
||||
]
|
||||
}
|
||||
const mergedOptions = { ...this.options }
|
||||
|
||||
mergedOptions.HTMLAttributes = mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes)
|
||||
const html = this.options.renderHTML({
|
||||
options: this.options,
|
||||
options: mergedOptions,
|
||||
node,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user