diff --git a/README.md b/README.md index fa0b07a..f47da4c 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,6 @@ easyMDE.value('New input for **EasyMDE**'); - **previewClass**: A string or array of strings that will be applied to the preview screen when activated. Defaults to `"editor-preview"`. - **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews. - **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`. -- **escapePromptURLs**: If set to `true`, urlencodes and escapes links entered via the JS prompt to prevent malformed Markdown rendered links. Only works when `promptURLs` is set to `true`. Defaults to `false`. - **promptTexts**: Customize the text used to prompt for URLs. - **image**: The text to use when prompting for an image's URL. Defaults to `URL of the image:`. - **link**: The text to use when prompting for a link's URL. Defaults to `URL for the link:`. @@ -277,7 +276,6 @@ const editor = new EasyMDE({ return "Loading..."; }, promptURLs: true, - escapePromptURLs: true, promptTexts: { image: "Custom prompt for URL:", link: "Custom prompt for URL:", diff --git a/src/js/easymde.js b/src/js/easymde.js index 8aedf80..db068ef 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -849,10 +849,8 @@ function drawLink(editor) { return false; } - if (options.escapePromptURLs) { - url = encodeURI(url); - if (/[()]/.test(url)) url = escapePromptURL(url); - } + url = encodeURI(url); + if (/[()]/.test(url)) url = escapePromptURL(url); } _replaceSelection(cm, stat.link, options.insertTexts.link, url); } @@ -871,10 +869,8 @@ function drawImage(editor) { return false; } - if (options.escapePromptURLs) { - url = encodeURI(url); - if (/[()]/.test(url)) url = escapePromptURL(url); - } + url = encodeURI(url); + if (/[()]/.test(url)) url = escapePromptURL(url); } _replaceSelection(cm, stat.image, options.insertTexts.image, url); } diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 12ba258..2aa161b 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -197,7 +197,6 @@ declare namespace EasyMDE { previewImagesInEditor?: boolean; previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; promptURLs?: boolean; - escapePromptURLs?: boolean; renderingConfig?: RenderingOptions; shortcuts?: Shortcuts; showIcons?: ReadonlyArray;