From b8660c11b4394e3c71ba4729221be8523b97b353 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Sun, 17 Dec 2023 21:52:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF=E8=BF=98=E5=AD=98?= =?UTF-8?q?=E5=9C=A8xml=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/output_pc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index e9f026a1..176c2533 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -420,7 +420,11 @@ def system_msg(self, doc, message): str_time = message[8] timestamp = message[5] is_chatroom = 1 if self.contact.is_chatroom else 0 - str_content = escape_js_and_html(str_content.lstrip('').rstrip('')) + str_content = str_content.lstrip('重新编辑]]>') + res = findall('()', str_content) + for xmlstr, b in res: + str_content = str_content.replace(xmlstr, "") + str_content = escape_js_and_html(str_content) if self.output_type == Output.HTML: doc.write( f'''{{ type:0, text: '{str_content}',is_send:{is_send},avatar_path:'',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:''}},''' From d6ed1396e67e45d9241395944f9c33ac06f53ed5 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Sun, 17 Dec 2023 22:09:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=BA=9B=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E8=BF=98=E5=AD=98=E5=9C=A8xml=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/output_pc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index 176c2533..80ecf128 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -420,8 +420,8 @@ def system_msg(self, doc, message): str_time = message[8] timestamp = message[5] is_chatroom = 1 if self.contact.is_chatroom else 0 - str_content = str_content.lstrip('重新编辑]]>') - res = findall('()', str_content) + str_content = str_content.replace('重新编辑]]>', "") + res = findall('()', str_content) for xmlstr, b in res: str_content = str_content.replace(xmlstr, "") str_content = escape_js_and_html(str_content)