-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toolbar button for mentions and references #443
Comments
Easily doable using custom toolbar buttons. const easyMDE = new EasyMDE({
toolbar: [
{
name: 'mention-hashtag',
title: "Mention",
action: (editor) => {
const cm = editor.codemirror;
const text = cm.getSelection(); // You can also implement your reference picker here.
cm.replaceSelection('#' + text);
},
className: "fa fa-hashtag",
}
]
}); |
Yes, but this would be easier to do using a built-in button. It would also be better to hook in the reference picker on input so it also works when the user types |
I agree that would be easier, but I'm trying to keep new configuration options tot a minimum until I have had the chance to rewrite the editor and get a better system for built-in buttons and plugins. I'll mark it as improvement and keep this open. |
Alright, sounds good. |
EasyMDE could provide toolbar buttons for mentions and references.
These buttons would only provide icons, tooltips and insert the character
@
and#
into the editor. Nothing more.It would be up to the user to implement hooks such as:
The text was updated successfully, but these errors were encountered: