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

Expose the options field type #522

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

borodean
Copy link
Contributor

This PR exposes the EasyMDE.prototype.options field and marks the guaranteed fields as non-nullable.

@Ionaru
Copy link
Owner

Ionaru commented Jan 12, 2023

Can you explain why you want access to the options property?

Also changing options usually has no effect after the editor is created, maybe those should be read-only?

@borodean
Copy link
Contributor Author

Hi, and thank you for an excellent library and a quick reply!

Can you explain why you want access to the options property?

I'm implementing an imageUploadFunction, and to mimic some of the original behavior, it wants to access the resolved options like insertTexts, imageMaxSize etc.

Also changing options usually has no effect after the editor is created, maybe those should be read-only?

If that's the case, I agree. We should make them read-only. Do you want me to push an update?

@borodean
Copy link
Contributor Author

I'm also unsure whether cherry-picking required fields will be challenging to maintain. Perhaps this would be enough:

options: EasyMDE.Options;

In this case, however, all the work of checking the fields for null/undefined falls on the shoulders of the end users.

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

2 participants