diff --git a/lib/nsui.js b/lib/nsui.js index bdc35ae..4582351 100644 --- a/lib/nsui.js +++ b/lib/nsui.js @@ -158,7 +158,7 @@ Nsui.prototype.formatInteger = function(num, len) { }; Nsui.prototype.formatMessage = function(msg) { - var dt = new Date(), fmt = ""; + var dt = new Date(), fmt = "", lnk_exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; fmt += '' + this.formatInteger(dt.getHours(), 2) + ':' + this.formatInteger(dt.getMinutes(), 2) + ':' + this.formatInteger(dt.getSeconds(), 2) + '
'; @@ -168,7 +168,8 @@ Nsui.prototype.formatMessage = function(msg) { fmt += '' + document.getElementById('login').value + ': '; } - fmt += this.sanitizeText(msg.message) + '
'; + fmt += this.sanitizeText(msg.message).replace(lnk_exp, '$1'); + fmt += ''; return fmt; };