static escapeInvalidChevrons_(input) {
    // Used to map HTML entities to characters.
    const htmlEscapes = {
      '< ': '',
      ' >': ' &gt;',
    };

    const reEscapedHtml = /(< +>|<\s|\s>)/g;
    const reHasEscapedHtml = RegExp(reEscapedHtml.source);
    // This check is an optimization, since replace always makes a copy
    if (input && reHasEscapedHtml.test(input)) {
      return input.replace(reEscapedHtml, (entity) => {
        return htmlEscapes[entity] || '';
      });
    }
    return input || '';
  }
This method converts invalid > chevrons to HTML entities.
It also removes < chevrons as per spec.

@param {!string} input
@return {string}
@private