mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: escape special characters in notification options
This commit is contained in:
parent
76a4560b56
commit
559be9d5b9
1 changed files with 4 additions and 3 deletions
|
|
@ -78,11 +78,12 @@ export async function showSystemNotification(options: NotificationOptions): Prom
|
|||
throw new Error("Message is required")
|
||||
}
|
||||
|
||||
const escape = (str: string = "") => str.replace(/\\/g, "\\\\").replace(/"/g, '\\"')
|
||||
const escapedOptions = {
|
||||
...options,
|
||||
title: title.replace(/"/g, '\\"'),
|
||||
message: message.replace(/"/g, '\\"'),
|
||||
subtitle: options.subtitle?.replace(/"/g, '\\"') || "",
|
||||
title: escape(title),
|
||||
message: escape(message),
|
||||
subtitle: escape(options.subtitle),
|
||||
}
|
||||
|
||||
switch (platform()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue