diff --git a/src/lib/components/Preview.svelte b/src/lib/components/Preview.svelte index f7dfe03..c980b48 100644 --- a/src/lib/components/Preview.svelte +++ b/src/lib/components/Preview.svelte @@ -1,8 +1,9 @@ -{#snippet sectionHeading(title: string, depth: number)} - {#if depth === 0} -

- {title} -

- {:else if depth === 1} -

- {title} -

- {:else if depth === 2} -

- {title} -

- {:else if depth === 3} -

- {title} -

- {:else if depth === 4} -
- {title} -
- {:else} -
- {title} -
- {/if} -{/snippet} - -{#snippet contentParagraph(content: string, publicationType: string)} - {#if publicationType === 'novel'} -

- {@html content} -

- {:else} -

- {@html content} -

- {/if} -{/snippet} -
{:else} - {@render contentParagraph(currentContent, publicationType)} + {@render contentParagraph(currentContent, publicationType, isSectionStart)} {/if} {/key} {:else} diff --git a/src/lib/snippets/PublicationSnippets.svelte b/src/lib/snippets/PublicationSnippets.svelte new file mode 100644 index 0000000..26645fa --- /dev/null +++ b/src/lib/snippets/PublicationSnippets.svelte @@ -0,0 +1,45 @@ + + +{#snippet sectionHeading(title: string, depth: number)} + {#if depth === 0} +

+ {title} +

+ {:else if depth === 1} +

+ {title} +

+ {:else if depth === 2} +

+ {title} +

+ {:else if depth === 3} +

+ {title} +

+ {:else if depth === 4} +
+ {title} +
+ {:else} +
+ {title} +
+ {/if} +{/snippet} + +{#snippet contentParagraph(content: string, publicationType: string, isSectionStart: boolean)} + {#if publicationType === 'novel'} +

+ {@html content} +

+ {:else} +

+ {@html content} +

+ {/if} +{/snippet}