Skip to content

Commit 42cbc47

Browse files
committed
Fix code block
1 parent 4e8ea89 commit 42cbc47

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/components/code.tsx

+8-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ const Code: React.FC<{ code: string; language: string }> = ({
1010
languages[language.toLowerCase()] || languages.javascript;
1111

1212
return (
13-
<code
14-
className="notion-code"
15-
dangerouslySetInnerHTML={{
16-
__html: highlight(code, prismLanguage, language)
17-
}}
18-
/>
13+
<pre>
14+
<code
15+
className="notion-code"
16+
dangerouslySetInnerHTML={{
17+
__html: highlight(code, prismLanguage, language)
18+
}}
19+
/>
20+
</pre>
1921
);
2022
};
2123

src/styles.css

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ h3 {
221221
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier,
222222
monospace;
223223
box-sizing: border-box;
224+
overflow-x: scroll;
224225
}
225226

226227
.notion-column {

0 commit comments

Comments
 (0)