rem: var prev = text.substring(0,(idx ? idx : text.length)); 
add: var prev = text.substring(0,(idx > 1 ? idx : limit)); 
context: function renderTextPreview(text,limit) {   var limit = Math.min(limit,text.length);   var text = stripTags(text);   var idx = 0;   while (idx < limit) {      var nIdx = text.indexOf(" ",idx);      if (nIdx < 0)         break;      idx = ++nIdx;   }   var prev = text.substring(0,(idx ? idx : text.length));   // and now we "enrich" the text with <wbr>-tags   for (var i=0;i<prev.length;i=i+30)      res.write(prev.substring(i,i+30) + "<wbr>");}
meta: 993	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/993/aae4bad0f9949a08461344590f06bdf5fdf6e164/renderFunctions.js/clean/code/Global/renderFunctions.js