🐛(frontend) fix export when quote block and inline code

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.
This commit is contained in:
Anthony LC
2025-08-29 18:42:04 +02:00
parent 09de014a43
commit 21ee38c218
3 changed files with 20 additions and 0 deletions

View File

@@ -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

View File

@@ -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' },
}
: {},
},
};

View File

@@ -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' } : {},
},
};