static parseCuePayload(cue, styles = new Map()) {
    const StringUtils = shaka.util.StringUtils;
    const TXml = shaka.util.TXml;
    let payload = cue.payload;
    if (!payload.includes('<')) {
      cue.payload = StringUtils.htmlUnescape(payload);
      return;
    }
    if (styles.size === 0) {
      shaka.text.Cue.addDefaultTextColor(styles);
    }
    payload = shaka.text.Cue.replaceKaraokeStylePayload_(payload);
    payload = shaka.text.Cue.replaceVoiceStylePayload_(payload);
    payload = shaka.text.Cue.escapeInvalidChevrons_(payload);

    cue.payload = '';

    const xmlPayload = '<span>' + payload + '</span>';
    let element;
    try {
      element = TXml.parseXmlString(xmlPayload, 'span');
    } catch (e) {
      shaka.log.warning('cue parse fail: ', e);
    }
    if (element) {
      const childNodes = element.children;
      if (childNodes.length == 1) {
        const childNode = childNodes[0];
        if (!TXml.isNode(childNode)) {
          cue.payload = StringUtils.htmlUnescape(payload);
          return;
        }
      }
      for (const childNode of childNodes) {
        shaka.text.Cue.generateCueFromElement_(childNode, cue, styles);
      }
    } else {
      shaka.log.warning('The cue\'s markup could not be parsed: ', payload);
      cue.payload = StringUtils.htmlUnescape(payload);
    }
  }
Parses cue payload, searches for styling entities and, if needed,
modifies original payload and creates nested cues to better represent
styling found in payload. All changes are done in-place.
@param {!shaka.text.Cue} cue
@param {!Map<string, !shaka.text.Cue>=} styles
@export