|
|
@@ -172,7 +172,7 @@ function escAttr(s){if(!s)return'';return s.replace(/"/g,'"').replace(/'/g,
|
|
|
function md2html(h){
|
|
|
if(!h)return'';h=esc(h);
|
|
|
// 保留图片标签不转义
|
|
|
-h=h.replace(/<img\s+src="(.+?)"\s*\/?>/g,'<img src="$1" style="max-width:100%">');
|
|
|
+h=h.replace(/<img\s+src="(.+?)"\s*\/?>/g,'<img src="$1" style="max-width:100%">');
|
|
|
h=h.replace(/\*\*(.+?)\*\*/g,'<strong>$1</strong>');
|
|
|
h=h.replace(/⚠️?\s*([^\n<]+)/g,'<span class="warn">$1</span>');
|
|
|
h=h.replace(/\[([^\]]+)\]\((https?:\/\/[^\s<>)]+)\)/g,'<a href="$2" target="_blank" rel="noopener" class="ext-link">$1</a>');
|