update code
This commit is contained in:
@@ -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';
|
||||
|
||||
// 显示统计数据
|
||||
|
||||
Reference in New Issue
Block a user