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:
parent
5f19670ed9
commit
274dafc47d
1 changed files with 11 additions and 3 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue