-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: remove HTML entity unescaping from apply_diff tools #5904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove HTML entity unescaping logic from applyDiffTool.ts for non-Claude models - Remove HTML entity unescaping logic from multiApplyDiffTool.ts for non-Claude models - Remove unused imports of unescapeHtmlEntities from both files - Add comprehensive test coverage for HTML entity handling scenarios - Preserve HTML entities in search content to ensure exact matching with file content - Fix search failures and unintended content modifications caused by entity unescaping Fixes #5633
|
@roomote-agent this needs to be a setting, you could add it as a VSCode setting in the global-settings file |
|
Thanks for the feedback @daniel-lxs! I'll implement this as a VSCode setting in the global-settings file. This will allow users to control whether HTML entity unescaping should be applied in diff tools. Working on it now. |
- Add unescapeHtmlEntitiesInDiffs setting to global-settings schema - Modify applyDiffTool.ts to use setting instead of hardcoded behavior - Modify multiApplyDiffTool.ts to use setting instead of hardcoded behavior - Add comprehensive tests for setting-based behavior - Default setting to false to preserve current behavior - Only applies to non-Claude models when enabled Addresses feedback from @daniel-lxs in PR #5904
|
✅ Implementation Complete! I've successfully implemented your feedback to make HTML entity unescaping configurable via a VSCode setting. Here's what was added: 🔧 New VSCode Setting
📝 Changes Made
🧪 Test CoverageAdded 3 new test cases covering:
🎯 Behavior
✅ Quality Assurance
This gives users full control over HTML entity handling in diff tools while maintaining backward compatibility! |
|
@roomote-agent use the switch_mode tool to switch to pr-fixer mode to fix the failing CI workflows, all your fixes should be committed to this PR, do not create a new one |
|
I see the request to fix the failing CI workflows. I will switch to pr-fixer mode and work on resolving the compilation errors, unit test failures, and integration test failures. I'll commit all fixes to this PR branch. |
…ol.ts - Renamed the second 'state' variable to 'providerState' to fix TypeScript compilation error - This resolves the CI failures in compile, unit test, and integration test jobs
|
✅ Fixed! All CI checks are now passing. The issue was a TypeScript compilation error in Fix applied:
The fix has been committed and pushed to the PR branch. All checks are green now! 🎉 |
|
@roomote-agent Please make the following changes to this PR:
"roo-cline.preserveHtmlEntitiesInDiffs": {
"type": "boolean",
"default": true,
"description": "Preserve HTML entities like &, <, > in diff search content to match file content exactly. When disabled, entities will be unescaped for non-Claude models."
}
This will make the setting more user-friendly and ensure it's properly configurable through VSCode settings. |
|
Hi @daniel-lxs! I see your request and I'm starting to work on the changes now. I'll:
I'll update you once the changes are complete. |
Fixes #5633
This PR resolves the critical HTML entity escaping/unescaping issue that was causing diff search/replace operations to fail or produce unintended content modifications.
The apply_diff tools were unescaping HTML entities in search content for non-Claude models, but the actual file content still contained the escaped entities. This caused search failures and unintended modifications.
This PR removes the HTML entity unescaping logic from applyDiffTool.ts and multiApplyDiffTool.ts for non-Claude models, preserves HTML entities in search content to ensure exact matching with file content, and adds comprehensive test coverage.
This reopens the work from the previously closed PR #5634 and provides a complete solution to issue #5633.
Important
Removes HTML entity unescaping from diff tools for non-Claude models, adds setting to control behavior, and introduces comprehensive tests.
applyDiffTool.tsandmultiApplyDiffTool.tsfor non-Claude models, ensuring search content matches file content.unescapeHtmlEntitiesInDiffssetting inglobal-settings.tsto control HTML entity unescaping.applyDiffHtmlEntity.spec.tsto test HTML entity handling in diff tools.This description was created by
for 47b04e1. You can customize this summary. It will automatically update as commits are pushed.