misc: add markdown to body preview

This commit is contained in:
Xyphyn committed 2023-07-29 12:40:06 -07:00
1 parent 17316b8cdf
commit ba6fc8cbeb
4 files changed
+19 -6

No files matched your search

+8 -2
View File
@@ -10,6 +10,7 @@
import Modal from '$lib/components/ui/modal/Modal.svelte'
import PostForm from '$lib/components/lemmy/post/PostForm.svelte'
import { ToastType, toast } from '$lib/components/ui/toasts/toasts.js'
import Markdown from '$lib/components/markdown/Markdown.svelte'
export let post: PostView
@@ -108,10 +109,15 @@
{/if}
{#if post.post.body && !post.post.nsfw}
<p
class="text-sm max-h-[74px] line-clamp-3 bg-slate-100 dark:bg-zinc-800
class="text-sm line-clamp-3 bg-slate-100 dark:bg-zinc-800
border border-slate-200 dark:border-zinc-700 rounded-md p-2"
>
{post.post.body}
<Markdown
inline
source={post.post.body.length > 200
? `${post.post.body.slice(0, 200)}...`
: post.post.body}
/>
</p>
{/if}
{/if}