fix an issue of duplicate span elements

This commit is contained in:
Mohammad Rasim 2023-11-22 01:47:00 +03:00 committed by Jan Thurau
parent 6058a53330
commit d43c477249

View File

@ -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 }) {