{#each cells as cell, i}
{#if cell.cell_type === 'markdown'}
{@html renderMarkdown(toStr(cell.source))}
{:else if cell.cell_type === 'code'}
{#if cell.execution_count !== undefined && cell.execution_count !== null} [{cell.execution_count}] {:else} [ ] {/if}
{#if highlightedCells[i]}
{@html highlightedCells[i]}
{:else}
{toStr(cell.source)}
{/if} {#if cell.outputs && cell.outputs.length > 0}
{#each cell.outputs as output} {#if output.output_type === 'error'}
{stripAnsi((output.traceback ?? []).join('\n') || `${output.ename}: ${output.evalue}`)}
{:else} {@const html = getOutputHtml(output)} {@const images = getOutputImages(output)} {@const text = getOutputText(output)} {#if html}
{@html html}
{/if} {#each images as src} Output {/each} {#if text}
{text}
{/if} {/if} {/each}
{/if}
{:else if cell.cell_type === 'raw'}
{toStr(cell.source)}
{/if}
{/each}