From 0ff280b0e89b5aee378ef42cc8869c51e9ecabe3 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Fri, 13 Feb 2026 18:38:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E7=95=99=20Markdown=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=8D=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/kb-deep-analyzer/deep_analyzer.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/skills/kb-deep-analyzer/deep_analyzer.py b/skills/kb-deep-analyzer/deep_analyzer.py index d1524dc..205f378 100644 --- a/skills/kb-deep-analyzer/deep_analyzer.py +++ b/skills/kb-deep-analyzer/deep_analyzer.py @@ -248,13 +248,6 @@ URL:{url} # 提取各部分(使用正则) lines = analysis_text.split('\n') - # 清理 Markdown 符号的辅助函数 - def clean_markdown(text): - text = re.sub(r'\*\*([^*]+)\*\*', r'\1', text) - text = re.sub(r'\*([^*]+)\*', r'\1', text) - text = re.sub(r'#+\s*', '', text) - return text.strip() - # 简单解析:按 ## 标题分割 current_section = "" in_section = None @@ -287,10 +280,6 @@ URL:{url} if not content: return - # 清理 content 中的 Markdown - content = re.sub(r'\*\*([^*]+)\*\*', r'\1', content) - content = re.sub(r'\*([^*]+)\*', r'\1', content) - section_lower = section_name.lower() if '摘要' in section_lower: @@ -467,11 +456,8 @@ def main(): print(f"[Main] 开始分析...") result = analyzer.analyze(metadata, content) - # 清理 Markdown 符号 + # 使用 AI 生成的原始内容(保留 Markdown 格式) full_analysis = result.full_analysis - full_analysis = re.sub(r'^#+\s*', '', full_analysis, flags=re.MULTILINE) - full_analysis = re.sub(r'\*\*([^*]+)\*\*', r'\1', full_analysis) - full_analysis = re.sub(r'\*([^*]+)\*', r'\1', full_analysis) # 删除内容中的"标签" section(只保留 frontmatter 中的 tags) # 匹配 ## 标签 或 标签(无##)到下一个 ## 或文件结尾之间的内容