mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-28 05:31:06 -06:00
Changed function name escapeURI to escapedPromptURL and option escapeURLs to option escapePromptURLs
This commit is contained in:
parent
33489ab616
commit
c174b6f149
@ -849,9 +849,9 @@ function drawLink(editor) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.escapeURLs) {
|
if (options.escapePromptURLs) {
|
||||||
url = encodeURI(url);
|
url = encodeURI(url);
|
||||||
if (/[()]/.test(url)) url = escapeURI(url);
|
if (/[()]/.test(url)) url = escapePromptURL(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_replaceSelection(cm, stat.link, options.insertTexts.link, url);
|
_replaceSelection(cm, stat.link, options.insertTexts.link, url);
|
||||||
@ -871,9 +871,9 @@ function drawImage(editor) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.escapeURLs) {
|
if (options.escapePromptURLs) {
|
||||||
url = encodeURI(url);
|
url = encodeURI(url);
|
||||||
if (/[()]/.test(url)) url = escapeURI(url);
|
if (/[()]/.test(url)) url = escapePromptURL(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_replaceSelection(cm, stat.image, options.insertTexts.image, 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
|
* Escape URLs to prevent breaking up rendered Markdown links
|
||||||
* @param url {string} The url of the link or image
|
* @param url {string} The url of the link or image
|
||||||
*/
|
*/
|
||||||
function escapeURI(url) {
|
function escapePromptURL(url) {
|
||||||
url = url.replace(/\(/g,'\\(').replace(/\)/g,'\\)');
|
url = url.replace(/\(/g,'\\(').replace(/\)/g,'\\)');
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user