diff --git a/lib/cloudfunc.js b/lib/cloudfunc.js index 71f420d1..0b5be258 100644 --- a/lib/cloudfunc.js +++ b/lib/cloudfunc.js @@ -34,6 +34,10 @@ var Util; this.CHANNEL_TERMINAL_RESIZE= 'terminal-resize'; this.MAX_FILE_SIZE = 500 * 1024; + function encodeSpace(str) { + return str.replace(/\s/g, ' '); + } + this.formatMsg = function(msg, name, status) { if (!status) status = 'ok'; @@ -223,7 +227,7 @@ var Util; linkResult = render(templateLink, { link : link, - name : file.name, + name : encodeSpace(file.name), attribute : attribute });