From 433dbe4ba0d948dbfd996727fa505d36cead264d Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:15:12 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/custom-form-builder.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index 1c52bb9..e8575d3 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -630,19 +630,22 @@ export function CustomFormBuilder() { ? AlignmentType.JUSTIFIED : AlignmentType.LEFT; const indentTwips = Math.round((seg.indent || 0) * 15); // ~px → twips (1px≈15twip) + const lines = applyVariables(seg.text, ctx).split("\n"); children.push( new DocxParagraph({ alignment: align, indent: indentTwips ? { left: indentTwips } : undefined, - children: [ - new TextRun({ - text: applyVariables(seg.text, ctx), + children: lines.flatMap((line, idx) => { + const run = new TextRun({ + text: line, font: fontFamily, size: fontSize * 2, italics: seg.caption, bold: !!seg.heading && seg.heading > 0, - }), - ], + break: idx > 0 ? 1 : undefined, + }); + return [run]; + }), }), ); }