static htmlEscapePreservingNewlinesAndSpaces(textOrHtml) {
    if (textOrHtml instanceof SafeHtml) {
      return textOrHtml;
    }
    const html = SafeHtml.htmlEscape(textOrHtml);
    return SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(
        internal.whitespaceEscape(SafeHtml.unwrap(html)));
  }
Returns HTML-escaped text as a SafeHtml object, with newlines changed to
&lt;br&gt; and escaping whitespace to preserve spatial formatting.
Character entity #160 is used to make it safer for XML.
@param {!SafeHtml.TextOrHtml_} textOrHtml The text to escape. If
    the parameter is of type SafeHtml it is returned directly (no escaping
    is done).
@return {!SafeHtml} The escaped text, wrapped as a SafeHtml.
@deprecated Use `safevalues.htmlEscape` instead.