From aa091014875904c7bcfc615a4ae468574a2c99a7 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Sun, 6 Apr 2025 08:43:58 +0200 Subject: [PATCH] made header handling more concise and dynamic section/disrete --- src/lib/components/Preview.svelte | 59 ++++--------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) diff --git a/src/lib/components/Preview.svelte b/src/lib/components/Preview.svelte index 0a1ffdb..6130feb 100644 --- a/src/lib/components/Preview.svelte +++ b/src/lib/components/Preview.svelte @@ -150,59 +150,12 @@ {#snippet sectionHeading(title: string, depth: number)} - {#if $pharosInstance.isFloatingTitle(rootId)} - {#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} - {:else} - {#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} - {/if} + {@const headingLevel = Math.min(depth + 1, 6)} + {@const className = $pharosInstance.isFloatingTitle(rootId) ? 'discrete' : 'h-leather'} + + + {title} + {/snippet} {#snippet contentParagraph(content: string, publicationType: string)}