From ddab4dcf4fead0bd00677795b0ad063e13f2b1a1 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Thu, 7 May 2026 18:04:07 +0200 Subject: [PATCH 1/2] Updated code block PDF conversion and styling --- .../xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx b/packages/xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx index ce8a924964..34985a1753 100644 --- a/packages/xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx +++ b/packages/xl-pdf-exporter/src/pdf/defaultSchema/blocks.tsx @@ -114,7 +114,12 @@ export const pdfBlockMappingForDefaultSchema: BlockMapping< ); }, codeBlock: (block) => { - const textContent = (block.content as StyledText[])[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 + // text content of all `StyledText` content in them. + const textContent = (block.content as StyledText[]) + .map((item) => item.text) + .join(""); const lines = textContent.split("\n").map((line, index) => { const indent = line.match(/^\s*/)?.[0].length || 0; @@ -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", From 3a5f79e807911114841065b2dc6f1f6ede5a98c3 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Fri, 8 May 2026 10:04:52 +0200 Subject: [PATCH 2/2] pdated test snapshots --- packages/xl-pdf-exporter/src/pdf/__snapshots__/example.jsx | 3 +-- .../src/pdf/__snapshots__/exampleWithHeaderAndFooter.jsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/xl-pdf-exporter/src/pdf/__snapshots__/example.jsx b/packages/xl-pdf-exporter/src/pdf/__snapshots__/example.jsx index 22c2781b56..71684acf42 100644 --- a/packages/xl-pdf-exporter/src/pdf/__snapshots__/example.jsx +++ b/packages/xl-pdf-exporter/src/pdf/__snapshots__/example.jsx @@ -1085,8 +1085,7 @@ >