{#each displayTokens as token, tokenIdx (tokenIdx)} {#if token.type === "hr"}
{:else if token.type === "heading"} {:else if token.type === "code"} {#if token.raw.includes("```")} { onSave({ raw: token.raw, oldContent: token.text, newContent: value, }); }} {onUpdate} {onPreview} /> {:else} {token.text} {/if} {:else if token.type === "table"}
{#each token.header as header, headerIdx} {/each} {#each token.rows as row, rowIdx} {#each row ?? [] as cell, cellIdx} {/each} {/each}
{:else if token.type === "blockquote"} {@const alert = alertComponent(token)} {#if alert} {:else}
{/if} {:else if token.type === "list"} {#if token.ordered}
    {#each token.items as item, itemIdx}
  1. {#if item?.task} { onTaskClick({ id: id, token: token, tokenIdx: tokenIdx, item: item, itemIdx: itemIdx, checked: e.target.checked, }); }} /> {/if}
  2. {/each}
{:else} {/if} {:else if token.type === "detail_group"}
{#each token.items as detailToken, detailIdx} {@const textContent = getDetailTextContent(detailToken)} {#if detailToken?.attributes?.type === "tool_calls"} {:else if textContent.length > 0}
{:else} {/if} {/each}
{:else if token.type === "details"} {@const textContent = getDetailTextContent(token)} {#if token?.attributes?.type === "tool_calls"} {:else if textContent.length > 0}
{:else} {/if} {:else if token.type === "html"} {:else if token.type === "iframe"} {:else if token.type === "paragraph"} {#if paragraphTag == "span"} {:else}

{/if} {:else if token.type === "text"} {#if top}

{#if token.tokens} {:else} {unescapeHtml(token.text)} {/if}

{:else if token.tokens} {:else} {unescapeHtml(token.text)} {/if} {:else if token.type === "inlineKatex"} {#if token.text} {/if} {:else if token.type === "blockKatex"} {#if token.text} {/if} {:else if token.type === "colonFence"} {:else if token.type === "space"}
{:else} {console.log("Unknown token", token)} {/if} {/each}