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.39k stars 316 forks source link

Can i upload PDF or Doc in this editor #247

Open DEEKSHITHATME opened 3 years ago

DEEKSHITHATME commented 3 years ago

Hi, i want to add another icon in toolbar to upload pdf or doc file just like image how can i extend this? Please help me with this

DEEKSHITHATME commented 3 years ago

@Ionaru Please check this.

Ionaru commented 3 years ago

You can definitely define a custom button that does this, but you'll have to write the code yourself.

new EasyMDE({
    toolbar: [
        // other buttons you want
        {
            name: 'document upload',
            className: "fas fa-file-alt",
            action: (editor) => {
                // Open file upload dialog.
                // Upload file to server.
                // Insert link to file in editor.
            }
        }
    ],
});