From 72ba5779507662049ba96b89c2224e1c45b42e35 Mon Sep 17 00:00:00 2001 From: Astra Date: Wed, 23 Apr 2025 04:10:14 +0000 Subject: [PATCH] Proper post word wrapping (#3) Co-authored-by: ari Reviewed-on: https://git.witchcraft.systems/scientific-witchery/pds-dash/pulls/3 --- src/App.svelte | 10 ++++++---- src/lib/PostComponent.svelte | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 9e36d30..733320e 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -16,7 +16,11 @@ }); }); // Infinite loading function - const onInfinite = ({ detail: { loaded, complete } } : { detail : { loaded : () => void, complete : () => void}}) => { + const onInfinite = ({ + detail: { loaded, complete }, + }: { + detail: { loaded: () => void; complete: () => void }; + }) => { getNextPosts().then((newPosts) => { console.log("Loading next posts..."); if (newPosts.length > 0) { @@ -53,9 +57,7 @@ {#each posts as postObject} {/each} - +
diff --git a/src/lib/PostComponent.svelte b/src/lib/PostComponent.svelte index 3c4178c..dc0b874 100644 --- a/src/lib/PostComponent.svelte +++ b/src/lib/PostComponent.svelte @@ -213,6 +213,10 @@ #postText { margin: 0; padding: 0; + overflow-wrap: break-word; + word-wrap: normal; + word-break: break-word; + hyphens: none; } #headerText { margin-left: 10px;