Change note preview to render markdown content
in the Collection/Itinerary view Closes #627
This commit is contained in:
@@ -5,6 +5,12 @@
|
|||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
const dispatch = createEventDispatcher();
|
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 Launch from '~icons/mdi/launch';
|
||||||
import TrashCan from '~icons/mdi/trash-can';
|
import TrashCan from '~icons/mdi/trash-can';
|
||||||
import Calendar from '~icons/mdi/calendar';
|
import Calendar from '~icons/mdi/calendar';
|
||||||
@@ -72,9 +78,11 @@
|
|||||||
<div class="badge badge-error">{$t('adventures.out_of_range')}</div>
|
<div class="badge badge-error">{$t('adventures.out_of_range')}</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if note.content && note.content.length > 0}
|
{#if note.content && note.content.length > 0}
|
||||||
<p class="line-clamp-6">
|
<article
|
||||||
{note.content}
|
class="prose overflow-auto max-h-72 max-w-full p-4 border border-neutral bg-base-100 rounded-lg mb-4 mt-4"
|
||||||
</p>
|
>
|
||||||
|
{@html renderMarkdown(note.content || '')}
|
||||||
|
</article>
|
||||||
{/if}
|
{/if}
|
||||||
{#if note.links && note.links.length > 0}
|
{#if note.links && note.links.length > 0}
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user