B2G/gecko/browser/base/content/pageinfo/pageInfo.js
// strip leading and trailing whitespace, and replace multiple consecutive whitespace characters with a single space
strip leading and trailing whitespace, and replace multiple consecutive whitespace characters with a single space
strip leading and trailing whitespace and replace multiple consecutive whitespace characters with a single space
function stripWS(text)
{
  var middleRE = /\s+/g;
  var endRE = /(^\s+)|(\s+$)/g;
  text = text.replace(middleRE, " ");
  return text.replace(endRE, "");
}
function stripWS ( text ) { var middleRE = / \s+ / g ; var endRE = / (^\s+)|(\s+$) / g ; text = text . replace ( middleRE , " " ) ; return text . replace ( endRE , "" ) ; }
strip leading and trailing whitespace, and replace multiple consecutive whitespace characters with a single space
strip leading and trailing whitespace and replace multiple consecutive whitespace characters with a single space