You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
I implemented a working mentions plugin for the editor, using the prosemirror-mentions plugin. I could not find documentation about how to do this, so it was lots of reading of code. I just wanted to share this in case it could be useful for someone else.
importEditorfrom"rich-markdown-editor";importMentions,{TagNode,MentionNode}from'./Mentions';exportconstcomponent=function({}){return(<Editorextensions={[newTagNode(),newMentionNode(),newMentions({getSuggestions(type,text,done){// write your own function to get suggestionsconstsuggestions=[];suggestions.push({id: '102',name: 'Joe Lewis',email: 'lewis@gmail.com',});done(suggestions);},})]}/>);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I implemented a working mentions plugin for the editor, using the
prosemirror-mentions
plugin. I could not find documentation about how to do this, so it was lots of reading of code. I just wanted to share this in case it could be useful for someone else.And implemented like this in my component:
Any tips or other comments are welcome.
Beta Was this translation helpful? Give feedback.
All reactions