Open robinvandernoord opened 6 months ago
I see how this can cause problems for certain form implementations.
To not introduce a breaking change, I propose a new option to rename the image form field, with the default value "image"
as it currently is.
Does this sound like a solution that works for you, @robinvandernoord?
Yes that sounds great! I think I can try to create that option and make a PR if you like. Or would you prefer to build it yourself?
I would appreciate any help you can give :)
https://github.com/Ionaru/easy-markdown-editor/pull/573
I have created a PR. I looked into adding a cypress test for it but I didn't find any existing tests related to this feature. Is that correct or am I looking in the wrong place?
The npm run test
still runs successfully.
I have also added the option to the easymde.d.ts
type declaration.
Describe the bug When using
upload-image
, an input with name="image" is created. This is a very generic name, which can conflict when using EasyMDE in a form.It changed the type from a file upload to a list of file uploads, and the inlined image was also not cleared, so my server received two files instead of one for my other 'image' field. Using a less generic name like 'easymde-image' would solve this issue.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect easymde to not impact the normal behavior of my form by using a namespaced input or clearing/removing the new input after usage.
Screenshots![image](https://github.com/Ionaru/easy-markdown-editor/assets/2529002/10d7f985-624c-477b-8da8-314e64794ec9)
Version information
Additional context This may be more of a feature request than a bug, but it broke my project so I'm reporting it as a bug :)