code: function fixSpaces(string) {
    if (string.charAt(0) == " ") string = nbsp + string.slice(1);
    return string.replace(/\t/g, function(){return makeWhiteSpace(indentUnit);})
      .replace(/[ \u00a0]{2,}/g, function(s) {return makeWhiteSpace(s.length);});
  }
docs: Create a set of white-space characters that will not be collapsed by the browser, but will not break text-wrapping either.