-
Notifications
You must be signed in to change notification settings - Fork 12
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
wip perplexity2 #21
base: main
Are you sure you want to change the base?
wip perplexity2 #21
Conversation
|
||
const escapeDollarSigns = (text: string | undefined) => { | ||
if (!text) return "Aider response over"; | ||
return text.replace(/\$/g, "\\$"); |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 11 hours ago
To fix the problem, we need to ensure that backslashes are also escaped in the escapeDollarSigns
function. This can be achieved by first replacing backslashes with double backslashes and then replacing dollar signs with escaped dollar signs. This ensures that both backslashes and dollar signs are properly escaped.
- Modify the
escapeDollarSigns
function to handle backslashes by adding an additional replace operation. - Ensure that the function uses regular expressions with the
g
flag to replace all occurrences of the characters.
-
Copy modified line R346
@@ -345,3 +345,3 @@ | ||
if (!text) return "Aider response over"; | ||
return text.replace(/\$/g, "\\$"); | ||
return text.replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); | ||
}; |
Description ✏️
Closes #xxx
What changed? Feel free to be brief.
Checklist ✅