From dfcb88dcceda82d131f5d369c1846b7921fc3e6f Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Tue, 19 Nov 2024 14:13:00 -0800 Subject: [PATCH] Fix some spacing issues in content --- src/app/components/Content.svelte | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/app/components/Content.svelte b/src/app/components/Content.svelte index e7816b1f..d905fd7a 100644 --- a/src/app/components/Content.svelte +++ b/src/app/components/Content.svelte @@ -44,6 +44,22 @@ showEntire = true } + const isBlock = (i: number) => { + const parsed = fullContent[i] + + if (!parsed || hideMedia) return true + + if (isLink(parsed) && isStartOrEnd(i) && $userSettingValues.show_media) { + return true + } + + if ((isEvent(parsed) || isAddress(parsed)) && isStartOrEnd(i) && depth < 2) { + return true + } + + return false + } + const isBoundary = (i: number) => { const parsed = fullContent[i] @@ -92,7 +108,7 @@ style={expandBlock ? "mask-image: linear-gradient(0deg, transparent 0px, black 100px)" : ""}> {#each shortContent as parsed, i} {#if isNewline(parsed)} - + {:else if isTopic(parsed)} {:else if isCode(parsed)} @@ -102,7 +118,7 @@ {:else if isCashu(parsed) || isInvoice(parsed)} {:else if isLink(parsed)} - {#if isStartOrEnd(i) && !hideMedia && $userSettingValues.show_media} + {#if isBlock(i)} {:else} @@ -110,7 +126,7 @@ {:else if isProfile(parsed)} {:else if isEvent(parsed) || isAddress(parsed)} - {#if isStartOrEnd(i) && depth < 2 && !hideMedia} + {#if isBlock(i)}