From a9775225649339e818b1b8f3b6a58d5469cd7173 Mon Sep 17 00:00:00 2001 From: Jony <951565127@qq.com> Date: Mon, 13 Apr 2026 01:20:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=AF=BB=E5=8F=96=20CHANGELOG.md=20=E8=80=8C?= =?UTF-8?q?=E9=9D=9E=20commit=20=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/update_checker.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/utils/update_checker.py b/utils/update_checker.py index 7275ea7..20ddaff 100644 --- a/utils/update_checker.py +++ b/utils/update_checker.py @@ -72,10 +72,9 @@ def check_for_updates() -> bool: def get_update_changelog() -> list: - """从远程 CHANGELOG.md 最新版本块中提取更新内容(最多3条)""" + """从远程 CHANGELOG.md 最新版本块中提取更新内容(最多5条)""" try: plugin_dir = os.path.dirname(os.path.dirname(__file__)) - # 读取远程最新的 CHANGELOG.md result = subprocess.run( ['git', 'show', 'origin/main:CHANGELOG.md'], cwd=plugin_dir, @@ -85,24 +84,21 @@ def get_update_changelog() -> list: ) lines = result.stdout.splitlines() - # 找到第一个版本块(## [x.x.x]) in_block = False items = [] for line in lines: if line.startswith('## [') and not line.startswith('## [Unreleased]'): if in_block: - break # 遇到下一个版本块,停止 + break in_block = True continue if in_block: stripped = line.strip() - # 提取有实际内容的行(跳过标题、空行、分隔线) - if stripped and not stripped.startswith('#') and not stripped.startswith('---') and not stripped.startswith('- '): - # 去掉 markdown 列表符号和加粗 + if stripped and not stripped.startswith('#') and not stripped.startswith('---'): text = stripped.lstrip('- ').replace('**', '').strip() if text and len(text) > 3: items.append(text) - if len(items) >= 3: + if len(items) >= 5: break return items