easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

Expose the `options` field type

Open borodean opened this issue 2 years ago • 3 comments

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

borodean avatar Jan 12 '23 13:01 borodean

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?

Ionaru avatar Jan 12 '23 14:01 Ionaru

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 avatar Jan 12 '23 15:01 borodean

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.

borodean avatar Jan 12 '23 16:01 borodean