BREAKING CHANGE: data-mention is not used to parse a mention id or label anymore

This commit is contained in:
Philipp Kühn
2021-06-14 16:22:09 +02:00
parent 299580a77d
commit c64761a9e5
4 changed files with 7 additions and 7 deletions

View File

@@ -72,7 +72,7 @@ export default () => {
],
content: `
<p>
What do you all think about the new <span data-mention="Winona Ryder"></span> movie?
What do you all think about the new <span data-mention data-id="Winona Ryder"></span> movie?
</p>
`,
})

View File

@@ -123,7 +123,7 @@ export default {
],
content: `
<p>
What do you all think about the new <span data-mention="Winona Ryder"></span> movie?
What do you all think about the new <span data-mention data-id="Winona Ryder"></span> movie?
</p>
`,
})

View File

@@ -82,9 +82,9 @@ export default {
],
content: `
<p>Hi everyone! Dont forget the daily stand up at 8 AM.</p>
<p><span data-mention="Jennifer Grey"></span> Would you mind to share what youve been working on lately? We fear not much happened since Dirty Dancing.
<p><span data-mention="Winona Ryder"></span> <span data-mention="Axl Rose"></span> Lets go through your most important points quickly.</p>
<p>I have a meeting with <span data-mention="Christina Applegate"></span> and dont want to come late.</p>
<p><span data-mention data-id="Jennifer Grey"></span> Would you mind to share what youve been working on lately? We fear not much happened since Dirty Dancing.
<p><span data-mention data-id="Winona Ryder"></span> <span data-mention data-id="Axl Rose"></span> Lets go through your most important points quickly.</p>
<p>I have a meeting with <span data-mention data-id="Christina Applegate"></span> and dont want to come late.</p>
<p> Thanks, your big boss</p>
`,
})

View File

@@ -49,7 +49,7 @@ export const Mention = Node.create<MentionOptions>({
default: null,
parseHTML: element => {
return {
id: element.getAttribute('data-mention'),
id: element.getAttribute('data-id'),
}
},
renderHTML: attributes => {
@@ -58,7 +58,7 @@ export const Mention = Node.create<MentionOptions>({
}
return {
'data-mention': attributes.id,
'data-id': attributes.id,
}
},
},