update code

This commit is contained in:
lychang
2025-11-13 23:05:14 +08:00
parent e81d9edbd5
commit c8ea28bcde
186 changed files with 561 additions and 324 deletions

View File

@@ -32,6 +32,8 @@ function generateCurrentWeekReport() {
generateReport();
}
function generateReport() {
const week = document.getElementById('week').value;
if (!week) {
@@ -52,8 +54,14 @@ function generateReport() {
if (data.success) {
// 保存原始Markdown内容到data属性
document.getElementById('report-content').setAttribute('data-markdown', data.report);
// 使用innerHTML显示格式化内容
document.getElementById('report-content').innerHTML = data.report.replace(/\n/g, '<br>');
// 将Markdown转换为HTML并显示
const htmlContent = markdownToHtml(data.report);
document.getElementById('report-content').innerHTML = htmlContent;
// 重置为预览模式
togglePreview('preview');
document.getElementById('report-container').style.display = 'block';
// 显示统计数据