Ionaru / Ionaru/easy-markdown-editor

Too Generic Image Input Name

Open
#571 5 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
3.1k
Forks
363
PR merge metrics
No merged PRs in 30d

Description

**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:
1. Create a form with a textarea and an image upload input called "image"
2. Enable easymde on the textarea
3. Enable "image-upload" in the easymde toolbar
4. Upload a file via easymde and in the normal input
5. Submit the form

**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**
- OS: Ubuntu
- Browser: Vivaldi (Chromium based) but it happens on all browsers
- EasyMDE version: 2.18.0

**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 :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.