{#each tokens as token, tokenIdx (tokenIdx)} {#if token.type === 'hr'}
{:else if token.type === 'heading'} {:else if token.type === 'code'} {#if token.raw.includes('```')} { dispatch('code', e.detail); }} on:save={(e) => { dispatch('update', { raw: token.raw, oldContent: token.text, newContent: e.detail }); }} /> {: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'}
{:else if token.type === 'list'} {#if token.ordered}
    {#each token.items as item, itemIdx}
  1. {/each}
{:else} {/if} {:else if token.type === 'details'}
{:else if token.type === 'html'} {@const html = DOMPurify.sanitize(token.text)} {#if html && html.includes(' {: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 === 'blockKatex'} {#if token.text} {/if} {:else if token.type === 'space'}
{:else} {console.log('Unknown token', token)} {/if} {/each}