Changed function name escapeURI to escapedPromptURL and option escapeURLs to option escapePromptURLs

pull/393/head
Zignature 2 years ago
parent 33489ab616
commit c174b6f149

@ -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;

Loading…
Cancel
Save