static splitMarkdownCodeSpans(text) {
    /** @type {Array<{isCode: true, text: string}|{isCode: false, text: string}>} */
    const segments = [];

    // Split on backticked code spans.
    const parts = text.split(/`(.*?)`/g);
    for (let i = 0; i < parts.length; i ++) {
      const text = parts[i];

      // Empty strings are an artifact of splitting, not meaningful.
      if (!text) continue;

      // Alternates between plain text and code segments.
      const isCode = i % 2 !== 0;
      segments.push({
        isCode,
        text,
      });
    }

    return segments;
  }
Split a string by markdown code spans (enclosed in `backticks`), splitting
into segments that were enclosed in backticks (marked as `isCode === true`)
and those that outside the backticks (`isCode === false`).
@param {string} text
@return {Array<{isCode: true, text: string}|{isCode: false, text: string}>}