We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 781feb2 commit 1424277Copy full SHA for 1424277
src/commands/show.ts
@@ -50,10 +50,11 @@ export async function showSolution(node?: LeetCodeNode): Promise<void> {
50
}
51
try {
52
let solution: string = await leetCodeExecutor.showSolution(node, language);
53
- // remove backslash in espaced \'...\'(generated by leetcode's database)
54
- solution = solution.replace(/\\'/g, "'");
+ // tslint:disable-next-line: no-eval
+ solution = eval(`"${solution.replace(/\n/g, "\\n")}"`); // decode solution string with escaped characters
55
await leetCodeSolutionProvider.show(solution, node);
56
} catch (error) {
57
+ leetCodeChannel.appendLine(error.toString());
58
await promptForOpenOutputChannel("Failed to fetch the top voted solution. Please open the output channel for details.", DialogType.error);
59
60
0 commit comments