Browse Source

Fix mention customization snippet in feature guide.

Maciej Gołaszewski 6 years ago
parent
commit
676deff5d1

+ 1 - 1
packages/ckeditor5-mention/docs/_snippets/features/mention-customization.js

@@ -54,7 +54,7 @@ function MentionCustomization( editor ) {
 				// The mention feature expects that the mention attribute value
 				// in the model is a plain object with set of additional attributes.
 				// In order to create proper object use `toMentionAttribute` helper method:
-				const mentionAttribute = editor.plugins.get( 'Mention' ).toMentionAttribute( {
+				const mentionAttribute = editor.plugins.get( 'Mention' ).toMentionAttribute( viewItem, {
 					// Add any other properties that you need.
 					link: viewItem.getAttribute( 'href' ),
 					userId: viewItem.getAttribute( 'data-user-id' )

+ 1 - 1
packages/ckeditor5-mention/docs/features/mention.md

@@ -286,7 +286,7 @@ function MentionCustomization( editor ) {
 				// The mention feature expects that the mention attribute value
 				// in the model is a plain object with set of additional attributes.
 				// In order to create proper object use `toMentionAttribute` helper method:
-				const mentionAttribute = editor.plugins.get( 'Mention' ).toMentionAttribute( {
+				const mentionAttribute = editor.plugins.get( 'Mention' ).toMentionAttribute( viewItem, {
 					// Add any other properties that you need.
 					link: viewItem.getAttribute( 'href' ),
 					userId: viewItem.getAttribute( 'data-user-id' )