File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,11 @@ export async function showSolution(node?: LeetCodeNode): Promise<void> {
5050 }
5151 try {
5252 let solution : string = await leetCodeExecutor . showSolution ( node , language ) ;
53- // remove backslash in espaced \'...\'(generated by leetcode's database)
54- solution = solution . replace ( / \\ ' / g, "'" ) ;
53+ // tslint:disable-next-line: no-eval
54+ solution = eval ( `" ${ solution . replace ( / \n / g, "\\n" ) } "` ) ; // decode solution string with escaped characters
5555 await leetCodeSolutionProvider . show ( solution , node ) ;
5656 } catch ( error ) {
57+ leetCodeChannel . appendLine ( error . toString ( ) ) ;
5758 await promptForOpenOutputChannel ( "Failed to fetch the top voted solution. Please open the output channel for details." , DialogType . error ) ;
5859 }
5960}
You can’t perform that action at this time.
0 commit comments