Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 02:15:12 +00:00
co-authored by renee-png
parent 6a9f7dbbef
commit 433dbe4ba0
+8 -5
View File
@@ -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];
}),
}),
);
}