We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7028a58 commit 7e11c87Copy full SHA for 7e11c87
packages/code-block/src/code-block.tsx
@@ -1,3 +1,4 @@
1
+/* eslint-disable react/no-array-index-key */
2
import * as React from "react";
3
import type { PrismLangauge } from "./languages-available";
4
import type { Theme } from "./themes";
@@ -28,9 +29,16 @@ const CodeBlockLine = ({
28
29
} else if (typeof token.content === "string") {
30
return <span style={theme[token.type]}>{token.content}</span>;
31
}
- } else if (typeof token === "string") {
32
- return token;
+ return (
33
+ <>
34
+ {token.content.map((subToken, i) => (
35
+ <CodeBlockLine key={i} theme={theme} token={subToken} />
36
+ ))}
37
+ </>
38
+ );
39
40
+
41
+ return <>{token}</>;
42
};
43
44
/**
0 commit comments