From 21ee38c21847aca65f820aa9b0425f0fd66850d1 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 29 Aug 2025 18:42:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(frontend)=20fix=20export=20when=20?= =?UTF-8?q?quote=20block=20and=20inline=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When exporting documents, if a inline code was inside a quote block, the PDF export was failing because the inline code was searching the GeistMono font in italics, which was not available. We switch to the core "Courier" font for code marks, which is available in italics. --- CHANGELOG.md | 1 + .../src/features/docs/doc-export/mappingDocx.tsx | 12 ++++++++++++ .../src/features/docs/doc-export/mappingPDF.tsx | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d947c0bc6..87d362ae0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to - 🐛(makefile) Windows compatibility fix for Docker volume mounting #1264 - 🐛(minio) fix user permission error with Minio and Windows #1264 +- 🐛(frontend) fix export when quote block and inline code #1319 ## [3.5.0] - 2025-07-31 diff --git a/src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx b/src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx index 46263b92c6..5c44f06073 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx @@ -24,4 +24,16 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = { interlinkingSearchInline: () => new Paragraph(''), interlinkingLinkInline: inlineContentMappingInterlinkingLinkDocx, }, + styleMapping: { + ...docxDefaultSchemaMappings.styleMapping, + // Switch to core PDF "Courier" font to avoid relying on GeistMono + // that is not available in italics + code: (enabled?: boolean) => + enabled + ? { + font: 'Courier New', + shading: { fill: 'DCDCDC' }, + } + : {}, + }, }; diff --git a/src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx b/src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx index 53cc90618e..9e96b32a4c 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx @@ -29,4 +29,11 @@ export const pdfDocsSchemaMappings: DocsExporterPDF['mappings'] = { interlinkingSearchInline: () => <>, interlinkingLinkInline: inlineContentMappingInterlinkingLinkPDF, }, + styleMapping: { + ...pdfDefaultSchemaMappings.styleMapping, + // Switch to core PDF "Courier" font to avoid relying on GeistMono + // that is not available in italics + code: (enabled?: boolean) => + enabled ? { fontFamily: 'Courier', backgroundColor: '#dcdcdc' } : {}, + }, };