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

Expose CodeMirror as static property #517

Open sn3p opened 1 year ago

sn3p commented 1 year ago

As requested in https://github.com/Ionaru/easy-markdown-editor/issues/495#issuecomment-1232130092 :)

Unfortunately the CodeMirror object from EasyMDE is not available at that moment, although exposing it on the EasyMDE object should not be difficult (EasyMDE.CodeMirror = CodeMirror; in easymde.js, PR anyone? 😉).

Ionaru commented 1 year ago

As discussed in #495, #514 and similar requests, I cannot guarantee a stable API when exposing CodeMirror or marked. Breaking changed to either package would mean a breaking change in this package. Tree-shaking might break anything from CodeMirror or marked that is used outside the editor.

I think a better option is to implement/expose specific configuration options that users of the editor need to achieve their goals.

sn3p commented 1 year ago

As discussed in https://github.com/Ionaru/easy-markdown-editor/issues/495 ...

You requested to expose it here 😆 But I do understand your concerns, feel free to close this PR.

It's just very frustrating you can't easily load CodeMirror modes before initializing eazyMDE. Came up with a workaround in https://github.com/Ionaru/easy-markdown-editor/issues/495#issuecomment-1381724853.