fix: Diff modal原始版本大段空白修复(20260420_0009)
- currentHtml提取后添加 replace(/>(\s+)</g, '><') 压缩标签间空白 - cleanHtml处理后同样压缩, 确保diff两侧格式对齐 - 消除模板源码排版换行被diff算法误识别为删除内容的问题
This commit is contained in:
@@ -930,7 +930,7 @@ export default function ReportEditor() {
|
||||
saveDraftToStorage();
|
||||
}
|
||||
}
|
||||
const currentHtml = targetRegionEl ? targetRegionEl.innerHTML.replace(/​/g, '').trim() : '';
|
||||
const currentHtml = targetRegionEl ? targetRegionEl.innerHTML.replace(/​/g, '').replace(/>(\s+)</g, '><').trim() : '';
|
||||
const globalContextText = editorRef.current?.innerText || '';
|
||||
let messageContent: any;
|
||||
const selectedFrameUrls = aiSelectedFrames.map(id => capturedFrames.find(f => f.id === id)?.dataUrl).filter(Boolean);
|
||||
@@ -1017,6 +1017,7 @@ export default function ReportEditor() {
|
||||
cleanHtml = cleanHtml.replace(/<br\s*\/?>/gi, '');
|
||||
cleanHtml = cleanHtml.replace(/<\/p>\s*<p>/gi, '</p><p>');
|
||||
cleanHtml = cleanHtml.trim();
|
||||
cleanHtml = cleanHtml.replace(/>(\s+)</g, '><');
|
||||
cleanHtml = cleanHtml.replace(/<p>/gi, '<p style="padding: 0px; font-family: SimSun; font-size: 12pt; line-height: 1.5;">');
|
||||
if (targetRegionEl) {
|
||||
setDiffModal({
|
||||
|
||||
Reference in New Issue
Block a user