feat(theme-4): sync inbox/announcements/presence/deposit from main

This commit is contained in:
2026-06-18 10:08:03 +08:00
parent d3ca8498fb
commit 5c5aa7e55a
87 changed files with 6911 additions and 1026 deletions

View File

@@ -0,0 +1,12 @@
/** 去除 HTML 标签,用于列表摘要与跑马灯纯文本 */
export function stripHtml(html: string): string {
if (!html) return '';
if (!/[<>]/.test(html)) return html.trim();
const doc = new DOMParser().parseFromString(html, 'text/html');
return (doc.body.textContent ?? '').replace(/\s+/g, ' ').trim();
}
/** 判断富文本是否实质为空 */
export function isHtmlEmpty(html: string): boolean {
return !stripHtml(html);
}