Skip to content

Commit

Permalink
sort the array
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Mar 6, 2024
1 parent 71ccb07 commit c487fbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site/src/components/code-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function normalizeIndentation(
spacesPerTab: number = 4,
): string[] {
const spacesSet = new Set(code.map((l) => numSpaces(l, spacesPerTab)));
const spacesArr = [...spacesSet];
const spacesArr = [...spacesSet].sort();
const spacesToIndent = new Map<number, string>(
spacesArr.map((value, index) => [value, ' '.repeat(index * indent)]),
);
Expand Down

0 comments on commit c487fbb

Please sign in to comment.