code: function encodeEntities(value) {
      return value.replace(/&/g, '&amp;')
          .replace(SURROGATE_PAIR_REGEXP, function (match) {
          var /** @type {?} */ hi = match.charCodeAt(0);
          var /** @type {?} */ low = match.charCodeAt(1);
          return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
      })
          .replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; })
          .replace(/</g, '&lt;')
          .replace(/>/g, '&gt;');
  }
docs: Escapes all potentially dangerous characters, so that the
  resulting string can be safely inserted into attribute or
  element text.
  @param {?} value
  @return {?}