OscarGodson / EpicEditor

EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.
http://epiceditor.com
MIT License
4.25k stars 338 forks source link

AMD import seems to be dead. #372

Closed samkelleher closed 9 years ago

samkelleher commented 9 years ago

The epiceditor.js file exports in AMD format only a 'marked' function, that accepts a src and opts arguments, and isn't a full EpicEditor object.

This basically does nothing.

Does EpicEditor not work with AMD module loaders?

samkelleher commented 9 years ago

Seen it, window.EpicEditor = EpicEditor;. Answer is no.

If you import the file with the same variable name, i.e. EpicEditor, you're actually importing the marked utilities AMD export. but at least the EpicEditor has been added as a global.

Solution is to import EpicEditor but give it any other name, like _EpicEditor, but continue to create a new EpicEditor object.