Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ac0287

Browse files
Vigilansjdneo
authored andcommitted
1 parentb90354e commit8ac0287

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

‎package-lock.json

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@
337337
"lodash":"^4.17.11",
338338
"markdown-it":"^8.4.2",
339339
"require-from-string":"^2.0.2",
340+
"unescape-js":"^1.1.1",
340341
"vsc-leetcode-cli":"2.6.3"
341342
}
342343
}

‎src/commands/show.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import*asfsefrom"fs-extra";
55
import*aspathfrom"path";
6+
import*asunescapeJSfrom"unescape-js";
67
import*asvscodefrom"vscode";
78
import{LeetCodeNode}from"../explorer/LeetCodeNode";
89
import{leetCodeChannel}from"../leetCodeChannel";
@@ -49,11 +50,10 @@ export async function showSolution(node?: LeetCodeNode): Promise<void> {
4950
return;
5051
}
5152
try{
52-
letsolution:string=awaitleetCodeExecutor.showSolution(node,language);
53-
// remove backslash in espaced \'...\'(generated by leetcode's database)
54-
solution=solution.replace(/\\'/g,"'");
55-
awaitleetCodeSolutionProvider.show(solution,node);
53+
constsolution:string=awaitleetCodeExecutor.showSolution(node,language);
54+
awaitleetCodeSolutionProvider.show(unescapeJS(solution),node);
5655
}catch(error){
56+
leetCodeChannel.appendLine(error.toString());
5757
awaitpromptForOpenOutputChannel("Failed to fetch the top voted solution. Please open the output channel for details.",DialogType.error);
5858
}
5959
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp