1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Remove post-ES5 code

This commit is contained in:
Scott Sauyet 2023-09-10 14:51:04 -04:00
parent 9cf1a39d85
commit 3249069e6a

View File

@ -294,10 +294,10 @@ for `+`) to a string
*/ */
$tw.utils.decodeTWURIList = function(s) { $tw.utils.decodeTWURIList = function(s) {
return $tw.utils.decodeURIComponentSafe( return $tw.utils.decodeURIComponentSafe(
s.split('&') s.split("&")
.map(function(s) {return s.replaceAll('+', ' ')}) .map(function(s) {return s.replace(/\+/g, " ")})
.map(function(s) {return s.includes(' ') ? '[[' + s + ']]' : s}) .map(function(s) {return s.indexOf(" ") >= 0 ? "[[" + s + "]]" : s})
.join( ' ') .join(" ")
) )
}; };
@ -307,7 +307,7 @@ for `+`) to a string
*/ */
$tw.utils.decodeTWURITarget = function(s) { $tw.utils.decodeTWURITarget = function(s) {
return $tw.utils.decodeURIComponentSafe( return $tw.utils.decodeURIComponentSafe(
s.replaceAll('+', ' ') s.replace(/\+/g, " ")
) )
}; };
@ -319,8 +319,8 @@ $tw.utils.encodeTWURIComponent = function(s) {
.filter(Boolean) .filter(Boolean)
.map(function(s) {return s.trim()}) .map(function(s) {return s.trim()})
.map(function(s) {return encodeURIComponent(s)}) .map(function(s) {return encodeURIComponent(s)})
.map(function(s) {return s.replaceAll('%20', '+')}) .map(function(s) {return s.replace(/\%20/g, '+')})
.join('&') .join("&")
}; };
/* /*