From 7e75b6e7abee87a497a27953af20e989b742f83f Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Mon, 29 May 2023 12:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8Dmarkdown=20=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolbox.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolbox.py b/toolbox.py index 7bc3fe4..fa1956e 100644 --- a/toolbox.py +++ b/toolbox.py @@ -368,7 +368,8 @@ def format_io(self, y): if y is None or y == []: return [] i_ask, gpt_reply = y[-1] - # i_ask = text_divide_paragraph(i_ask) # 输入部分太自由,预处理一波 + #i_ask = text_divide_paragraph(i_ask) # 输入部分太自由,预处理一波 + i_ask = re.sub(r'\n+', '\n\n', i_ask) gpt_reply = close_up_code_segment_during_stream(gpt_reply) # 当代码输出半截的时候,试着补上后个``` y[-1] = ( # None if i_ask is None else markdown.markdown(i_ask, extensions=['fenced_code', 'tables']),