Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ export const pdfBlockMappingForDefaultSchema: BlockMapping<
);
},
codeBlock: (block) => {
const textContent = (block.content as StyledText<any>[])[0]?.text || "";
// Code blocks should always contain a single `StyledText` inline content.
// However, if this is not the case for whatever reason, we can merge the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I suppose we have no idea how this happened?

// text content of all `StyledText` content in them.
const textContent = (block.content as StyledText<any>[])
.map((item) => item.text)
.join("");
const lines = textContent.split("\n").map((line, index) => {
const indent = line.match(/^\s*/)?.[0].length || 0;

Expand All @@ -135,8 +140,7 @@ export const pdfBlockMappingForDefaultSchema: BlockMapping<
wrap={false}
style={{
padding: 24 * PIXELS_PER_POINT,
backgroundColor: "#161616",
color: "#ffffff",
border: "1px solid #000000",
lineHeight: 1.25,
fontSize: FONT_SIZE * PIXELS_PER_POINT,
fontFamily: "GeistMono",
Expand Down
Loading