{#if type} {#if renderers[type]} {@const Renderer = renderers[type]} {#each tokens as token} {#if type != 'list' && type != 'table'} {#if token.tokens && token.tokens.length > 0} {:else if token.text} {token.text} {:else if text} {text} {/if} {:else if type == 'list' && token.items} {#each token.items as item} {/each} {:else if type == 'table'} {@const THead = renderers['tablehead']} {@const TBody = renderers['tablebody']} {@const TRow = renderers['tablerow']} {#if token.header} {#each token.header as heading, index} {/each} {/if} {#if token.rows} {#each token.rows as row} {#each row as cell, index} {/each} {/each} {/if} {/if} {/each} {/if} {:else} {#each tokens as token} {/each} {/if}