easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Add checklist toolbar button

Open skylarmt opened this issue 6 years ago • 3 comments

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.

skylarmt avatar Nov 26 '18 04:11 skylarmt

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',
    ],
});

nunesvictor avatar Oct 01 '19 12:10 nunesvictor

How to add class to link button, btn and btn-primary?

bsde1245 avatar Nov 19 '19 05:11 bsde1245

does anyone have this working on return? e.g. create a new checklist item on return if current line is a checklist?

mike-seekwell avatar Sep 01 '21 17:09 mike-seekwell