Merge pull request #157 from STDquantum/master

解决了一些系统消息还存在xml的问题
This commit is contained in:
SiYuan 2023-12-17 23:14:46 +08:00 committed by GitHub
commit e40fe57e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,7 +423,11 @@ class ChildThread(QThread):
str_time = message[8] str_time = message[8]
timestamp = message[5] timestamp = message[5]
is_chatroom = 1 if self.contact.is_chatroom else 0 is_chatroom = 1 if self.contact.is_chatroom else 0
str_content = escape_js_and_html(str_content.lstrip('<revokemsg>').rstrip('</revokemsg>')) str_content = str_content.replace('<![CDATA[', "").replace(' <a href="weixin://revoke_edit_click">重新编辑</a>]]>', "")
res = findall('(</{0,1}(img|revo|_wc_cus|a).*?>)', 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: if self.output_type == Output.HTML:
doc.write( doc.write(
f'''{{ type:0, text: '{str_content}',is_send:{is_send},avatar_path:'',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:''}},''' f'''{{ type:0, text: '{str_content}',is_send:{is_send},avatar_path:'',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:''}},'''