diff --git a/frontend/index.html b/frontend/index.html
index edecab2..ce23bf3 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -1129,23 +1129,25 @@ function mdRender(md){
tbls.push(h);
return '\u0000TBL'+(tbls.length-1)+'\u0000';
});
- // 2) 行内 + 引用 + 空行
+ // 2) 行内 + 引用 + 标题 + 列表(块结构处理须在空行替换之前,避免 \n\n→
破坏行结构)
var esc=mdInline(md);
esc=esc.replace(/^> (.+)$/gm,'
$1
');
- esc=esc.replace(/\n{2,}/g,'
');
- // 2.5) 标题(一级→h3 二级→h4 三级→h5,避免层级过大)
+ // 标题(一级→h3 二级→h4 三级→h5,避免层级过大)
esc=esc.replace(/^### (.+)$/gm,'$1
');
esc=esc.replace(/^## (.+)$/gm,'$1
');
esc=esc.replace(/^# (.+)$/gm,'$1
');
- // 2.6) 无序/有序列表 → /
+ // 无序列表 → (连续 - 行)
esc=esc.replace(/(?:^|\n)((?:[ \t]*[-*+] .+(?:\n|$))+)/g, function(_,blk){
var items=blk.split('\n').filter(function(l){return l.trim();}).map(function(l){return '- '+l.replace(/^\s*[-*+]\s+/,'')+'
';});
return '';
});
+ // 有序列表 → (连续 "1. " 行)
esc=esc.replace(/(?:^|\n)((?:\d+[.)] .+(?:\n|$))+)/g, function(_,blk){
var items=blk.split('\n').filter(function(l){return l.trim();}).map(function(l){return '- '+l.replace(/^\s*\d+[.)]\s+/,'')+'
';});
return ''+items.join('')+'
';
});
+ // 空行 →
+ esc=esc.replace(/\n{2,}/g,'
');
// 3) 还原表格
for(var i=0;i