From e82ffcc91203eb0e578400d7e03856b192d78086 Mon Sep 17 00:00:00 2001 From: Clivia <132346501+Yanyutin753@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:52:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=BC=8F=E5=AD=97=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d3ac33e..1043e2a 100644 --- a/main.py +++ b/main.py @@ -1443,10 +1443,11 @@ def data_fetcher(upstream_response, data_queue, stop_event, last_data_time, api_ else: # 只获取新的 parts parts = content.get("parts", []) - full_text = ''.join(parts) - new_text = full_text[len(last_full_text):] - if full_text != '': - last_full_text = full_text # 更新完整文本以备下次比较 + full_text = ''.join(parts) + if full_text == "![": + last_full_text = "!" + new_text = full_text[len(last_full_text):] + last_full_text = full_text if "\u3010" in new_text and not citation_accumulating: citation_accumulating = True citation_buffer = citation_buffer + new_text