Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
afcbf3a52f
commit
c6cee5409a
@@ -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,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user