Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.31k stars 308 forks source link

Add indent and outdent toolbar buttons #555

Open kmantel opened 11 months ago

kmantel commented 11 months ago

Use commands 'tabAndIndentMarkdownList' and 'shiftTabAndUnindentMarkdownList' assigned to keyboard shortcuts.

kmantel commented 11 months ago

Solves #232

Ionaru commented 10 months ago

Thank you for the contribution!

It all looks good to me except for one small thing: the placement of the buttons when enabled is maybe a little strange. I'd expect them closer to (maybe next to?) the unordered-list and ordered-list buttons like they are in MS Word.

image

I'll leave the choice to you, just say "merge" and I'll click merge. :)

LGTM

kmantel commented 10 months ago

Thank you for the contribution!

It all looks good to me except for one small thing: the placement of the buttons when enabled is maybe a little strange. I'd expect them closer to (maybe next to?) the unordered-list and ordered-list buttons like they are in MS Word.

image

I'll leave the choice to you, just say "merge" and I'll click merge. :)

LGTM

I just added everything to the end, so it wasn't a calculated choice. Do you mean this part setting the default toolbar?

https://github.com/kmantel/easy-markdown-editor/blob/4d35093129d6388a955ab85a473167b9f24e09a7/src/js/easymde.js#L1705-L1718

   'indent': {
        name: 'indent',
        action: indent,
        className: iconClassMap['indent'],
        noDisable: true,
        title: 'Indent',
    },
    'outdent': {
        name: 'outdent',
        action: outdent,
        className: iconClassMap['outdent'],
        noDisable: true,
        title: 'Outdent',
    },

I don't mind moving them between whatever elements you prefer.

kmantel commented 10 months ago

And I have been using outdent to the left of indent like in that image, so I'll change that as well.