fix: remove some magic strings

This commit is contained in:
Philipp Kühn
2021-12-02 14:56:57 +01:00
parent dedcf17d53
commit 6c34dec33a
25 changed files with 61 additions and 60 deletions

View File

@@ -105,7 +105,7 @@ export const Mention = Node.create<MentionOptions>({
parseHTML() {
return [
{
tag: 'span[data-mention]',
tag: `span[data-type="${this.name}"]`,
},
]
},
@@ -113,7 +113,7 @@ export const Mention = Node.create<MentionOptions>({
renderHTML({ node, HTMLAttributes }) {
return [
'span',
mergeAttributes({ 'data-mention': '' }, this.options.HTMLAttributes, HTMLAttributes),
mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes),
this.options.renderLabel({
options: this.options,
node,