perf: speed up app loading

This commit is contained in:
boos
2026-06-06 19:21:59 +08:00
parent 9c1e5ae293
commit ef0f91e683
8 changed files with 272 additions and 118 deletions
@@ -1,4 +1,3 @@
import { marked } from 'marked';
import { formatDateTimeLocal } from './checkinLogTime.js';
const VOID_TAGS = new Set(['br', 'hr', 'img']);
@@ -367,8 +366,7 @@ export function renderSiteAnnouncementHtml(content: string): string {
}
if (isLikelyMarkdown(raw)) {
const rendered = String(marked.parse(raw, { gfm: true, breaks: true }));
return sanitizeAnnouncementHtml(rendered || renderMarkdown(raw));
return sanitizeAnnouncementHtml(renderMarkdown(raw));
}
return renderPlainText(raw);