fix: 文档Tab用真正的markdown渲染mdRender(移植自AgentsMeeting)——支持标题/列表/表格/代码块/引用,替代简单inMd

This commit is contained in:
hmo
2026-08-11 10:57:33 +08:00
parent 9886dffd8e
commit 68b13034b1
+2 -2
View File
@@ -2010,7 +2010,7 @@ async function _docsRead(path) {
} else {
content.innerHTML =
'<div class="mb-2 text-xs text-slate-500 border-b border-slate-800 pb-2">📄 ' + path + '</div>' +
'<div class="prose-invert bg-slate-900/50 border border-slate-800 rounded-xl p-5 whitespace-pre-wrap leading-relaxed text-slate-300">' + inMd(data.content) + '</div>';
'<div class="bg-slate-900/50 border border-slate-800 rounded-xl p-5">' + mdRender(data.content) + '</div>';
}
}
@@ -2023,7 +2023,7 @@ function _renderVersionsHTML(md) {
const body = lines.slice(1).join('\n').trim();
return '<div class="mb-4 border border-slate-800 rounded-xl p-4 bg-slate-900/50">' +
'<div class="font-semibold text-slate-100 mb-2 text-base">' + title + '</div>' +
'<div class="text-slate-300 whitespace-pre-wrap leading-relaxed text-[13px]">' + inMd(body) + '</div>' +
'<div class="text-slate-300 leading-relaxed text-[13px]">' + mdRender(body) + '</div>' +
'</div>';
}).join('');
return '<div class="mb-2 text-xs text-slate-500 border-b border-slate-800 pb-2">📜 版本变更记录(给运营者的详细说明)</div>' + cards;