1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-22 14:29:36 +02:00

Change note preview to render markdown content

in the Collection/Itinerary view

Closes #627
This commit is contained in:
Florian Meinicke 2025-05-21 07:33:20 +00:00
parent 5f19670ed9
commit 274dafc47d

View file

@ -5,6 +5,12 @@
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
import { marked } from 'marked'; // Import the markdown parser
const renderMarkdown = (markdown: string) => {
return marked(markdown);
};
import Launch from '~icons/mdi/launch';
import TrashCan from '~icons/mdi/trash-can';
import Calendar from '~icons/mdi/calendar';
@ -72,9 +78,11 @@
<div class="badge badge-error">{$t('adventures.out_of_range')}</div>
{/if}
{#if note.content && note.content.length > 0}
<p class="line-clamp-6">
{note.content}
</p>
<article
class="prose overflow-auto max-h-72 max-w-full p-4 border border-neutral bg-base-100 rounded-lg mb-4 mt-4"
>
{@html renderMarkdown(note.content || '')}
</article>
{/if}
{#if note.links && note.links.length > 0}
<p>