mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
fix an issue of duplicate span elements
This commit is contained in:
parent
6058a53330
commit
d43c477249
@ -131,14 +131,19 @@ export const Mention = Node.create<MentionOptions>({
|
||||
}),
|
||||
]
|
||||
}
|
||||
return [
|
||||
'span',
|
||||
mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes),
|
||||
this.options.renderHTML({
|
||||
options: this.options,
|
||||
node,
|
||||
}),
|
||||
]
|
||||
const html = this.options.renderHTML({
|
||||
options: this.options,
|
||||
node,
|
||||
})
|
||||
|
||||
if (typeof html === 'string') {
|
||||
return [
|
||||
'span',
|
||||
mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes),
|
||||
html,
|
||||
]
|
||||
}
|
||||
return html
|
||||
},
|
||||
|
||||
renderText({ node }) {
|
||||
|
Loading…
Reference in New Issue
Block a user