From 91621af63f2623fefdf14e119ecaad79a6363ff0 Mon Sep 17 00:00:00 2001 From: w_xiaolizu Date: Tue, 6 Jun 2023 11:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A6=96=E6=AC=A1=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD,=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E4=B8=BA=E7=A9=BA=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolbox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolbox.py b/toolbox.py index 2db8c8e..e92216c 100644 --- a/toolbox.py +++ b/toolbox.py @@ -260,11 +260,11 @@ def text_divide_paragraph(input_str): """ 将文本按照段落分隔符分割开,生成带有段落标签的HTML代码。 """ - code_blocks = re.findall('```.*?```', input_str, re.DOTALL) + code_blocks = re.findall('```.*?```', str(input_str), re.DOTALL) for block in code_blocks: input_str = input_str.replace(block, f'{{{{{{{{{{{code_blocks.index(block)}}}}}}}}}}}') # 将除了三个反引号之间的文本块以外的 "\n" 替换为 "\n\n" - input_str = re.sub(r'(?!```)(?