Skip to content

Commit c25bc62

Browse files
committed
Add double quote escaping
1 parent 1424277 commit c25bc62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/show.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function showSolution(node?: LeetCodeNode): Promise<void> {
5151
try {
5252
let solution: string = await leetCodeExecutor.showSolution(node, language);
5353
// tslint:disable-next-line: no-eval
54-
solution = eval(`"${solution.replace(/\n/g, "\\n")}"`); // decode solution string with escaped characters
54+
solution = eval(`"${solution.replace(/\n/g, "\\n").replace(/"/g, '\\"')}"`); // decode solution string with escaped characters
5555
await leetCodeSolutionProvider.show(solution, node);
5656
} catch (error) {
5757
leetCodeChannel.appendLine(error.toString());

0 commit comments

Comments
 (0)