Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 16:28:50 +00:00
co-authored by renee-png
parent afcbf3a52f
commit c6cee5409a
+9 -2
View File
@@ -902,12 +902,19 @@ export function CustomFormBuilder() {
? AlignmentType.JUSTIFIED
: AlignmentType.LEFT;
const indentTwips = Math.round((seg.indent || 0) * 15); // ~px → twips (1px≈15twip)
const baseRuns = buildDocxRuns(seg.runs, { italic: seg.caption });
const runsWithMarker = seg.marker
? [
new TextRun({ text: `${seg.marker}\t`, font: fontFamily, size: fontSize * 2 }),
...baseRuns,
]
: baseRuns;
children.push(
new DocxParagraph({
alignment: align,
spacing: docxLineSpacing,
indent: indentTwips ? { left: indentTwips } : undefined,
children: buildDocxRuns(seg.runs, { italic: seg.caption }),
indent: indentTwips ? { left: indentTwips, hanging: seg.marker ? 360 : undefined } : seg.marker ? { left: 360, hanging: 360 } : undefined,
children: runsWithMarker,
}),
);
}