From 3fbd064abcae407e6898d58a414edd2bb20f3973 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Sun, 23 Mar 2014 20:17:14 +0400 Subject: [PATCH] fix break of links and emails --- js/twister_formatpost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 5d7df38..313982b 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -179,7 +179,7 @@ function htmlFormatMsg( msg, output, mentions ) { if( reHttp.exec(match[1]) ) { output.append(_formatText(msg.substr(0, index))); tmp = msg.substring(index); - var space = tmp.indexOf(" "); + var space = tmp.search(/[ \n\t]/); var url; if( space != -1 ) url = tmp.substring(0,space); else url = tmp; if( url.length ) { @@ -198,7 +198,7 @@ function htmlFormatMsg( msg, output, mentions ) { if( reEmail.exec(match[1]) ) { output.append(_formatText(msg.substr(0, index))); tmp = msg.substring(index); - var space = tmp.indexOf(" "); + var space = tmp.search(/[ \n\t]/); var email; if( space != -1 ) email = tmp.substring(0,space); else email = tmp; if( email.length ) {