Now with a description and basic color scheme. Saving before making some more changes.
This commit is contained in:
@@ -2,6 +2,7 @@ import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
import { db_journals } from "$lib/ae_journals/db_journals";
|
||||
import { marked } from 'marked';
|
||||
|
||||
import { load_ae_obj_li__journal_entry } from "$lib/ae_journals/ae_journals__journal_entry";
|
||||
|
||||
@@ -536,6 +537,12 @@ export function db_save_ae_obj_li__journal(
|
||||
console.log(`ae_obj ${obj_type}:`, obj);
|
||||
}
|
||||
|
||||
let description = obj.description ?? '';
|
||||
// remove the most common zerowidth characters from the start of the file
|
||||
let description_cleaned: string = description.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/,"");
|
||||
let description_md_html: null|string = await marked.parse(description_cleaned ?? '') ?? null;
|
||||
// let description_md_html_alt: null|string = await marked.parse(description_cleaned ?? '', { gfm: false }) ?? null;
|
||||
|
||||
try {
|
||||
const id_random = await db_journals.journal.put({
|
||||
id: obj.journal_id_random,
|
||||
@@ -557,6 +564,7 @@ export function db_save_ae_obj_li__journal(
|
||||
outline: obj.outline,
|
||||
|
||||
description: obj.description,
|
||||
description_md_html: description_md_html, // Use the markdown parser to generate HTML
|
||||
description_html: obj.description_html,
|
||||
description_json: obj.description_json,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user