Skip to content

Commit 4cd5711

Browse files
author
Ruben Carvalho
committed
fix: Fix code indentation by setting white-space to pre
1 parent 81bc51e commit 4cd5711

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

pages/code-view/simple.page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default function CodeViewPage() {
88
<ScreenshotArea>
99
<h1>Code View</h1>
1010
<CodeView content={"Hello World"} />
11+
<CodeView
12+
content={`public class HelloWorld {\n public static void main(String[] args) {\n System.out.println("Hello, World!");\n }\n}`}
13+
/>
1114
</ScreenshotArea>
1215
);
1316
}

pages/code-view/with-line-wrapping.page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export default function CodeViewPage() {
2929
lineNumbers={true}
3030
content={`Hello this is a short line.\nHello this is a long line. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\nHello this is another short line.`}
3131
/>
32+
<CodeView
33+
lineWrapping={true}
34+
lineNumbers={true}
35+
content={`public class HelloWorld {\n public static void main(String[] args) {\n System.out.println("Hello, World!");\n }\n}`}
36+
/>
3237
</SpaceBetween>
3338
</ScreenshotArea>
3439
);

src/code-view/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $color-background-code-view-dark: #282c34;
6464
white-space: pre-wrap;
6565
}
6666
&-nowrap {
67-
white-space: nowrap;
67+
white-space: pre;
6868
}
6969
}
7070

0 commit comments

Comments
 (0)