mirror of
https://github.com/ILoveBingLu/CipherTalk.git
synced 2026-06-10 14:52:39 +08:00
fix: 修复 issue #92 中的 4 个 bug
- fix(MomentsWindow): 修复朋友圈刷新崩溃问题 - 新增 postsRef 追踪最新 posts 状态,避免触发重渲染 - loadPosts 中改用 postsRef.current 读取数据 - 从 useCallback 依赖数组移除 posts,断开依赖循环 - fix(exportService): 修复群聊导出数据串问题 - 改进 findMessageTable 哈希匹配为大小写无关的精确匹配 - 匹配失败返回 null,不再回退到第一个表 - fix(exportService): 修复导出 HTML 实体转义乱码问题 - 增强 decodeHtmlEntities,支持   
 等常见实体 - 对 content、senderDisplayName、formattedTime 字段解码 - fix(exportService): 修复红包/群收款显示原始 XML 问题 - parseChatHistory 中过滤 datatype=2001 和 2002 的消息 - fix(htmlExportGenerator): 新增浏览器端二次解码兜底 关闭 #92
This commit is contained in:
@@ -878,10 +878,19 @@ body {
|
||||
return 'c' + (Math.abs(hash) % 8);
|
||||
}
|
||||
|
||||
// HTML 实体解码(防止导出数据中残留   等转义字符)
|
||||
function decodeEntities(text) {
|
||||
if (!text) return '';
|
||||
const d = document.createElement('textarea');
|
||||
d.innerHTML = text;
|
||||
return d.value;
|
||||
}
|
||||
|
||||
// HTML 转义
|
||||
function esc(text) {
|
||||
const decoded = decodeEntities(String(text || ''));
|
||||
const d = document.createElement('div');
|
||||
d.textContent = text;
|
||||
d.textContent = decoded;
|
||||
return d.innerHTML;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user