code: function escapeTeamCityString(str) {
    if (!str) {
      return '';
    }
  
    return str.replace(/\|/g, '||')
      .replace(/\'/g, '|\'')
      .replace(/\n/g, '|n')
      .replace(/\r/g, '|r')
      .replace(/\u0085/g, '|x')
      .replace(/\u2028/g, '|l')
      .replace(/\u2029/g, '|p')
      .replace(/\[/g, '|[')
      .replace(/\]/g, '|]');
  }
docs: ------------------------------------------------------------------------------ Helpers ------------------------------------------------------------------------------ 
  Escape special characters with the respective TeamCity escaping.
  @param {string} str An error message to display in TeamCity.
  @returns {string} An error message formatted for display in TeamCity