mirror of
https://github.com/LifeArchiveProject/WeChatDataAnalysis.git
synced 2026-06-18 15:54:08 +08:00
improvement(chat-export): 收敛导出 CSS 打包范围,避免 Scoped 规则泄漏
- 仅打包聊天页相关的 _nuxt/*_username_*.css,避免去 scoped 选择器后污染全局 - Offline viewer CSS patch 引入 --dpr 缩放,改善不同 DPR 下的显示一致性 - 移除 chatHistoryModal 的静态 HTML 输出,改由 data 标记驱动 - 修正聊天记录解析正则中的空白匹配转义 - 更新导出相关测试断言(移除 modal id/放宽字体资源/校验不引入 wrapped 样式)
This commit is contained in:
@@ -307,7 +307,6 @@ class TestChatExportHtmlFormat(unittest.TestCase):
|
||||
self.assertIn('data-wce-time-divider="1"', html_text)
|
||||
self.assertIn('id="messageTypeFilter"', html_text)
|
||||
self.assertIn('value="chatHistory"', html_text)
|
||||
self.assertIn('id="chatHistoryModal"', html_text)
|
||||
self.assertIn('data-wce-chat-history="1"', html_text)
|
||||
self.assertIn('data-record-item-b64="', html_text)
|
||||
self.assertIn('id="wceMediaIndex"', html_text)
|
||||
@@ -334,6 +333,7 @@ class TestChatExportHtmlFormat(unittest.TestCase):
|
||||
css_text = zf.read("assets/wechat-chat-export.css").decode("utf-8", errors="ignore")
|
||||
self.assertIn("wechat-transfer-card", css_text)
|
||||
self.assertNotIn("wechat-transfer-card[data-v-", css_text)
|
||||
self.assertNotIn("bento-container", css_text)
|
||||
|
||||
js_text = zf.read("assets/wechat-chat-export.js").decode("utf-8", errors="ignore")
|
||||
self.assertIn("wechat-voice-bubble", js_text)
|
||||
@@ -343,7 +343,6 @@ class TestChatExportHtmlFormat(unittest.TestCase):
|
||||
self.assertIn("assets/images/wechat/wechat-trans-icon1.png", names)
|
||||
self.assertIn("assets/images/wechat/zip.png", names)
|
||||
self.assertIn("assets/images/wechat/WeChat-Icon-Logo.wine.svg", names)
|
||||
self.assertTrue(any(n.startswith("fonts/") and n.endswith(".woff2") for n in names))
|
||||
self.assertIn("wxemoji/Expression_1@2x.png", names)
|
||||
self.assertIn("../../wxemoji/Expression_1@2x.png", html_text)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user