Rovak / InlineAttachment

Easily paste and upload files/images in plain textareas
http://git.razko.nl/InlineAttachment
MIT License
619 stars 77 forks source link

fix bug where pasting a string causes upload #69

Closed zilkey closed 8 years ago

zilkey commented 8 years ago

This PR fixes a bug that occurs when users have allowedTypes: '*' and they paste a string. Before this PR, it would attempt (and fail) to upload a file, and insert the [Uploading file...]() message in the editor.

This PR fixes that by returning false from inlineAttachment.prototype.isFileAllowed if the pasted item is a string.

Rovak commented 8 years ago

It looks like merging your other PR caused a merge conflict with this one (most likely the dist files). I'll fix this in the weekend and tag a new version. Thanks for the improvements!