Skip to content

Commit ed8e6c1

Browse files
committed
Fixed export error
1 parent 3a1e4ca commit ed8e6c1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

packages/core/src/blocks/Code/helpers/render/createSourceBlockWithPreview.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,12 @@ export const createSourceBlockWithPreview = (
266266
options && "selectedLanguage" in options ? options : undefined,
267267
);
268268

269-
const sourceCode = (block.content as StyledText<any>[])
270-
.map(({ text }) => text)
271-
.join("");
269+
const sourceCode =
270+
typeof block.content === "string"
271+
? block.content
272+
: Array.isArray(block.content)
273+
? (block.content as StyledText<any>[]).map(({ text }) => text).join("")
274+
: "";
272275

273276
// Tracks the source the preview was last rendered from, so `update` can tell
274277
// a source-text change (which it handles in place) from any other update.

0 commit comments

Comments
 (0)