summaryrefslogtreecommitdiff
path: root/ui/lib/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/lib/components')
-rw-r--r--ui/lib/components/Message.svelte6
-rw-r--r--ui/lib/components/MessageRun.svelte4
2 files changed, 3 insertions, 7 deletions
diff --git a/ui/lib/components/Message.svelte b/ui/lib/components/Message.svelte
index 0c8eeec..fddeecd 100644
--- a/ui/lib/components/Message.svelte
+++ b/ui/lib/components/Message.svelte
@@ -1,15 +1,11 @@
<script>
- import { marked } from 'marked';
- import DOMPurify from 'dompurify';
-
import { deleteMessage } from '$lib/apiServer';
function scroll(message) {
message.scrollIntoView();
}
- let { id, at, body, editable = false } = $props();
- let renderedBody = $derived(DOMPurify.sanitize(marked.parse(body, { breaks: true })));
+ let { id, at, body, renderedBody, editable = false } = $props();
let deleteArmed = $state(false);
function onDelete(event) {
diff --git a/ui/lib/components/MessageRun.svelte b/ui/lib/components/MessageRun.svelte
index 83a82a9..39ee155 100644
--- a/ui/lib/components/MessageRun.svelte
+++ b/ui/lib/components/MessageRun.svelte
@@ -16,7 +16,7 @@
<span class="chip variant-soft sticky top-o left-0">
@{name}:
</span>
- {#each messages as { id, at, body }}
- <Message {id} {at} {body} editable={ownMessage} />
+ {#each messages as { id, at, body, renderedBody }}
+ <Message {id} {at} {body} {renderedBody} editable={ownMessage} />
{/each}
</div>