最终维护:修复字符级对比并明确项目边界 - #1
Draft
Dreamtale235 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更
.gitignore,避免提交本机.claude配置原因
原实现先对全文执行字符级 LCS,再分别处理插入和删除的换行符。遇到跨行修改时,同一处变化可能触发两次行输出,导致左右行错位;统计逻辑也只识别纯新增或纯删除行,使修改行被误计为未变或漏计新增。
用户影响
按字模式现在能稳定保留原始行边界,修改行与按行模式采用一致的统计口径;纯新增和纯删除不再出现幽灵空行。页面也明确说明 DOCX/Excel 只提取文本、解析库首次加载需要联网,避免把工具误解为完整 Office 格式比较或严格离线软件。
验证
+2 新增 / -1 删除 / =2 未变,左右各 4 个对齐结果行+1/-0,纯删除+0/-1,按行与按字一致+1/-1,约 159 ms+1/-1/=4999,约 431 msindex.html与diff-checker.htmlSHA-256 完全一致git diff --check通过;文件保持 UTF-8 无 BOM、CRLF