Fix: Escape HTML special characters to prevent VSCode crash on Windows #6042
+237
−2
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.
Fixes #6041
This PR implements HTML escaping for all messages sent to the webview to prevent special characters from breaking the webview parser and crashing VSCode on Windows.
Problem
VSCode crashes on Windows when the Roo Code extension attempts to display apply_diff content containing special characters like
<<<<<<< SEARCH
. These characters are not properly escaped before being sent to the webview.Solution
Testing
Important
Implement HTML escaping for webview messages to prevent VSCode crashes on Windows due to unescaped special characters.
ClineMessage
content inTask
andClineProvider
.escapeHtml
,escapeHtmlInObject
, andescapeClineMessage
inhtmlEscape.ts
.htmlEscape.spec.ts
to verify escaping functionality for various cases, including special characters and diff markers.This description was created by
for 3c02b80. You can customize this summary. It will automatically update as commits are pushed.