Skip to content

Commit 084f090

Browse files
committed
fix: parseCodeIntoLines function
1 parent c4f13d5 commit 084f090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ export function parseCodeIntoLines(
3636

3737
return code
3838
.split(/\r?\n/)
39-
.map((line) => line.trimEnd())
40-
.filter((l) => l.length > 0);
39+
.map((line) => line.replace(/\s+$/, ''))
40+
.filter((line) => line.length > 0 || line === '');
4141
}

0 commit comments

Comments
 (0)