diff --git a/src/lib/ae_journals/ae_journals__journal_entry.ts b/src/lib/ae_journals/ae_journals__journal_entry.ts index afdfd52a..c127efb4 100644 --- a/src/lib/ae_journals/ae_journals__journal_entry.ts +++ b/src/lib/ae_journals/ae_journals__journal_entry.ts @@ -339,7 +339,10 @@ export async function db_save_ae_obj_li__journal_entry( } let content = obj.content ?? ''; - let content_md_html: null|string = marked.parse(content); + // remove the most common zerowidth characters from the start of the file + let content_cleaned: string = content.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/,""); + let content_md_html: null|string = await marked.parse(content_cleaned ?? '') ?? null; + // let content_md_html_alt: null|string = await marked.parse(content_cleaned ?? '', { gfm: false }) ?? null; try { const id_random = await db_journals.journal_entry.put({ @@ -378,6 +381,7 @@ export async function db_save_ae_obj_li__journal_entry( content: obj.content, content_md_html: content_md_html, + // content_md_html_alt: content_md_html_alt, content_html: obj.content_html, content_json: obj.content_json, diff --git a/src/lib/ae_journals/db_journals.ts b/src/lib/ae_journals/db_journals.ts index a31ed4df..61b3ee78 100644 --- a/src/lib/ae_journals/db_journals.ts +++ b/src/lib/ae_journals/db_journals.ts @@ -136,12 +136,12 @@ export interface Journal { } -// Updated 2025-03-15 +// Updated 2025-04-02 export interface Journal_Entry { id: string; // actually "id_random" journal_entry_id: string; - // journal_id: string; // This is the parent journal ID. If deleted, then delete all children journal entries. + journal_id: string; // This is the parent journal ID. If deleted, then delete all children journal entries. // Essentially this is a change log of journal entries snapshot_id?: string; // This is the original journal ID. If deleted, then delete all children journal entries. @@ -183,6 +183,7 @@ export interface Journal_Entry { content?: null|string; content_md_html?: null|string; // Markdown converted to HTML based on content + content_md_html_alt?: null|string; // Markdown converted to HTML based on content content_html?: null|string; content_json?: null|string; diff --git a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte index 0560f12e..b2741283 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte @@ -728,7 +728,9 @@ $effect(() => { class:hidden={!$ae_loc.trusted_access || $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]} class="w-full font-mono shadow-md rounded-lg border-gray-500 bg-gray-100 p-2" > -
+
{@html $lq__journal_entry_obj?.content_md_html}
diff --git a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte index 938a312f..e6578e03 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_li.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_li.svelte @@ -11,7 +11,7 @@ import { NotebookPen, NotebookText, NotepadTextDashed, RemoveFormatting, Shapes, Siren, - Tags + Tags, TypeOutline } from '@lucide/svelte'; @@ -171,6 +171,44 @@ let tmp_entry_obj: key_val = $state({}); + + + + +
@@ -244,6 +282,13 @@ let tmp_entry_obj: key_val = $state({}); > {@html journals_journal_entry_obj.content}
+ + + {/if}