summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 251f64ba..7349d2bf 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -464,10 +464,15 @@ function pflo(s) {
}
function uf(s) {
- return escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B");
+ if (s.length == 0)
+ return "_";
+ return (s[0] == '_' ? "_" : "")
+ + escape(s).replace(new RegExp ("/", "g"), "%2F").replace(new RegExp ("\\+", "g"), "%2B");
}
function uu(s) {
+ if (s.length > 0 && s[0] == '_')
+ s = s.substring(1);
return unescape(s.replace(new RegExp ("\\+", "g"), " "));
}