{#each tokens as token, tokenIdx} {#if token.type === 'hr'}
{:else if token.type === 'heading'} {:else if token.type === 'code'} {: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'}
{:else if token.type === 'list'} {#if token.ordered}
    {#each token.items as item, itemIdx}
  1. {/each}
{:else} {/if} {:else if token.type === 'html'} {@html token.text} {:else if token.type === 'paragraph'}

{: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 === 'space'} {''} {:else} {console.log('Unknown token', token)} {/if} {/each}