Skip to content

Commit fa8e6c2

Browse files
fix: correct path escaping in prompt card webview
1 parent 015530a commit fa8e6c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ui/promptCardsWebview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ export class PromptCardsWebviewProvider implements vscode.WebviewViewProvider {
984984
function renderPromptCard(prompt) {
985985
const typeIcon = getTypeIcon(prompt.type);
986986
// Escape characters in paths for JavaScript single-quoted strings (Windows compatibility)
987-
const escapedPath = String(prompt.path).replace(/\\/g, '\\\\').replace(/'/g, '\\\'');
987+
const escapedPath = prompt.path.replace(/\\\\/g, '\\\\\\\\');
988988
return \`
989989
<div class="prompt-card \${prompt.type} \${prompt.active ? 'active' : ''}" onclick="viewPrompt('\${escapedPath}')">
990990
<div class="card-header">

0 commit comments

Comments
 (0)