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

Examples don't work #378

Closed erossini closed 2 years ago

erossini commented 2 years ago

I try to run the examples but they don't work. First, the path in the link and script is not correct. This is the working index.html

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Example / Preview</title>
    <link rel="stylesheet" href="../src/css/easymde.css">
    <script src="../src/js/easymde.js"></script>
</head>

<body>
    <textarea></textarea>
    <script>
        const easyMDE = new EasyMDE();
    </script>
</body>

</html>

Then, the other issues are:

If I use the distribution, the upload of an image seems not working.

Ionaru commented 2 years ago

You have modified the script path, that is why the editor is not working. It should be ../dist/easymde.min.js. You can not use src/js/easymde.js in a browser.

Image uploading requires a working server to receive the image, set with imageUploadEndpoint. Look in the README.md for more info.

erossini commented 2 years ago

Ok, thank you for the answer. I'm not an expert in JavaScript but I was trying to debug the script to find a way to have the dropped file. I opened another question with all the details.

erossini commented 2 years ago

Oh, I opened 2 questions :) This is a similar one.