From ca935eda202afeaf8cd858885cfb735a55f6b8ea Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sat, 22 Aug 2026 04:21:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(doc):=20GetDoc=20=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=20HTML=20=E6=96=87=E6=A1=A3=E4=B8=BA=20html?= =?UTF-8?q?=20=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 内容以 污染站点样式(配合前端 @layer 隔离) - TempLate 同步 GVSite 最新构建产物 --- TempLate/index.html | 2 +- backup/www/index.html | 2 +- gvsds/apps/core/views.py | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/TempLate/index.html b/TempLate/index.html index 95ab5441..4283b6f3 100644 --- a/TempLate/index.html +++ b/TempLate/index.html @@ -5,7 +5,7 @@ 银河锋锐(GVSDS) - + diff --git a/backup/www/index.html b/backup/www/index.html index a979603b..9f09a59a 100644 --- a/backup/www/index.html +++ b/backup/www/index.html @@ -5,7 +5,7 @@ 银河锋锐(GVSDS) - + diff --git a/gvsds/apps/core/views.py b/gvsds/apps/core/views.py index 56f3bd87..e6cd0c9c 100644 --- a/gvsds/apps/core/views.py +++ b/gvsds/apps/core/views.py @@ -161,10 +161,15 @@ def _doc_api(file_path): doc = DocManager.GetDocument(uuid_bytes) if doc is None: return JsonResponse({'error': 'not_found'}, status=404) + content = doc.DocContent or '' + doc_format = doc.DocFormat + # 数据兜底:内容实为完整 HTML 文档时按 html 渲染(marked 会把内嵌 拆坏,污染站点样式) + if doc_format == 'markdown' and content.lstrip().lower().startswith(('