diff --git a/src/js/easymde.js b/src/js/easymde.js index 93b3cdee..de0d9750 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1870,6 +1870,7 @@ function EasyMDE(options) { options.imagePathAbsolute = options.imagePathAbsolute || false; options.imageCSRFName = options.imageCSRFName || 'csrfmiddlewaretoken'; options.imageCSRFHeader = options.imageCSRFHeader || false; + options.imageInputName = options.imageInputName || 'image'; // Change unique_id to uniqueId for backwards compatibility @@ -2689,7 +2690,7 @@ EasyMDE.prototype.createToolbar = function (items) { imageInput.className = 'imageInput'; imageInput.type = 'file'; imageInput.multiple = true; - imageInput.name = 'image'; + imageInput.name = self.options.imageInputName; imageInput.accept = self.options.imageAccept; imageInput.style.display = 'none'; imageInput.style.opacity = 0; diff --git a/types/easymde.d.ts b/types/easymde.d.ts index daacc235..351939a6 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -227,6 +227,7 @@ declare namespace EasyMDE { imageCSRFName?: string; imageCSRFHeader?: boolean; imageTexts?: ImageTextsOptions; + imageInputName?: string errorMessages?: ImageErrorTextsOptions; errorCallback?: (errorMessage: string) => void;