Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CodeMirror object accessible. #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scottfalkingham
Copy link

This surfaces the CodeMirror object as a global variable so it is available to perform advanced functions such as CodeMirror.defineMode, which was impossible previously.

For more information see this SimpleMDE issue.

@axe312ger
Copy link

Why not require CodeMirror on your own? You just inject the require of this lib into the window object.

@Ionaru
Copy link
Owner

Ionaru commented Apr 8, 2019

I am also not sure about this change. What is the use-case for using the editor's CodeMirror package instead of importing your own? That should be easy enough to keep in sync.

Say the editor would at some point use tree-shaking to make the dist package smaller then it wouldn't even be the full CodeMirror package that is exposed.

@coconutpalm
Copy link

Maybe a better solution would be for Easy MDE to use window.CodeMirror if it exists? Then if clients want to supply their own CodeMirror (perhaps with an expanded set of modules included), we would just pick that up. Otherwise, we would do what we do right now.

@A-312
Copy link

A-312 commented Mar 13, 2020

@Ionaru Can you explain your message ? I also want to make a custom highlighter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants