From 39c5d24447635f675783dcf90d8b6dd5c2fae3d8 Mon Sep 17 00:00:00 2001 From: ylhan Date: Tue, 22 Sep 2026 21:24:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=BE=E7=89=87=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E6=8C=82=E8=BD=BD=E8=B7=AF=E5=BE=84(?= =?UTF-8?q?=E6=97=A0=E5=B0=BE=E6=96=9C=E6=9D=A0=E4=B9=9F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?);=20=E6=97=B6=E9=97=B4=E6=88=B3=E7=BB=9F=E4=B8=80UTC+=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=9C=AC=E5=9C=B0=E6=98=BE=E7=A4=BA,=20=E6=8C=81?= =?UTF-8?q?=E4=B9=85=E5=8C=96=E4=BC=9A=E8=AF=9D=E5=AF=86=E9=92=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xinquan/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xinquan/app.py b/xinquan/app.py index f4836ee..f05dfff 100644 --- a/xinquan/app.py +++ b/xinquan/app.py @@ -201,7 +201,10 @@ function api(path, opts){ }); } function esc(s){const d=document.createElement('div');d.textContent=s;return d.innerHTML;} -function md(s){ try{return marked.parse(s||'');}catch(e){return esc(s);} } +function md(s){ + s=(s||'').replace(/\(media\//g,'('+BASE+'/media/'); // 相对 media 路径补全为绝对,避免无尾斜杠时解析到根路径 + try{return marked.parse(s);}catch(e){return esc(s);} +} const state={pages:[], mode:'list', current:null, content:''}; const umarked = typeof marked==='undefined';