Browse code

Improved the whitespace formatting for tweets where there are lots of consecutive new lines

Brandon Mathis authored on 08/06/2011 at 22:03:43
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ function showTwitterFeed(tweets, twitter_user){
26 26
   var timeline = document.getElementById('tweets');
27 27
   timeline.innerHTML='';
28 28
   for (t in tweets){
29
-    timeline.innerHTML+='<li>'+'<p>'+'<a href="http://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n{2}/, '</p><p>').replace(/\n/, '<br>'))+'</p>'+'</li>';
29
+    timeline.innerHTML+='<li>'+'<p>'+'<a href="http://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'))+'</p>'+'</li>';
30 30
   }
31 31
 }
32 32
 function linkifyTweet(text){