From c174b6f149ce9dd6d540beda91331ba7a936e593 Mon Sep 17 00:00:00 2001 From: Zignature Date: Sat, 15 Jan 2022 23:34:05 +0100 Subject: [PATCH] Changed function name escapeURI to escapedPromptURL and option escapeURLs to option escapePromptURLs --- src/js/easymde.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index b419d5d..8aedf80 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -849,9 +849,9 @@ function drawLink(editor) { return false; } - if (options.escapeURLs) { + if (options.escapePromptURLs) { url = encodeURI(url); - if (/[()]/.test(url)) url = escapeURI(url); + if (/[()]/.test(url)) url = escapePromptURL(url); } } _replaceSelection(cm, stat.link, options.insertTexts.link, url); @@ -871,9 +871,9 @@ function drawImage(editor) { return false; } - if (options.escapeURLs) { + if (options.escapePromptURLs) { url = encodeURI(url); - if (/[()]/.test(url)) url = escapeURI(url); + if (/[()]/.test(url)) url = escapePromptURL(url); } } _replaceSelection(cm, stat.image, options.insertTexts.image, url); @@ -883,7 +883,7 @@ function drawImage(editor) { * Escape URLs to prevent breaking up rendered Markdown links * @param url {string} The url of the link or image */ -function escapeURI(url) { +function escapePromptURL(url) { url = url.replace(/\(/g,'\\(').replace(/\)/g,'\\)'); return url;