fix: normalize numbered lists in PDFKit fallback renderer
The Puppeteer path uses <br> tags; the PDFKit fallback now normalizes "1) ... 2) ..." patterns to newline-separated text via PDFKit's native text rendering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -845,13 +845,15 @@ class PDFGenerationService {
|
||||
// Add section content
|
||||
Object.entries(section.data).forEach(([key, value]) => {
|
||||
if (value && typeof value !== 'object') {
|
||||
// Normalize inline numbered lists to newline-separated
|
||||
const normalizedValue = String(value).replace(/\.\s+(\d+)\)\s/g, '.\n$1) ');
|
||||
doc.fontSize(10)
|
||||
.font('Helvetica-Bold')
|
||||
.text(`${this.formatFieldName(key)}:`, { continued: true });
|
||||
.text(`${this.formatFieldName(key)}:`);
|
||||
|
||||
doc.fontSize(10)
|
||||
.font('Helvetica')
|
||||
.text(` ${value}`);
|
||||
.text(normalizedValue, { lineGap: 2 });
|
||||
|
||||
doc.moveDown(0.3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user