Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
4k stars 614 forks source link

Add the ability to restrict image types #1477

Open ataylor32 opened 2 months ago

ataylor32 commented 2 months ago

The "base64" and "upload" plugins both have the accept attribute set to image/*:

https://github.com/Alex-D/Trumbowyg/blob/v2.28.0/plugins/base64/trumbowyg.base64.js#L150

https://github.com/Alex-D/Trumbowyg/blob/v2.28.0/plugins/upload/trumbowyg.upload.js#L212

It would be nice if this was configurable. Currently, any image type is allowed, including .bmp, .ico, and others. I would like to have the ability to restrict this to only certain image types.