easy-markdown-editor
easy-markdown-editor copied to clipboard
Add checklist toolbar button
I'm submitting a...
- [x] Feature request
It would be great to have another type of list (in addition to generic and numbered) that starts each line with - [ ]
for easy building of to-do lists and other such things.
You can do it your own by creating a custom toolbar action:
new SimpleMDEEditor({
toolbar: ['bold',
'italic',
'strikethrough',
'|',
// this is what you're looking for
{
name: 'checklist',
action: (e) => {
e.codemirror.replaceSelection('- [ ] ');
e.codemirror.focus();
},
className: 'fa fa-check-square-o',
title: 'Add task list',
},
'|',
'preview',
],
});
How to add class to link button, btn and btn-primary?
does anyone have this working on return? e.g. create a new checklist item on return if current line is a checklist?