diff --git a/packages/pdf/src/templates/shared/base-template-styles.ts b/packages/pdf/src/templates/shared/base-template-styles.ts index db10ba0ce..bea0a659c 100644 --- a/packages/pdf/src/templates/shared/base-template-styles.ts +++ b/packages/pdf/src/templates/shared/base-template-styles.ts @@ -87,11 +87,12 @@ export function createBaseTemplateStyles({ metadata, foreground, r, metrics, pic ...bodyText, width: metadata.typography.body.fontSize, textAlign: r.listMarkerTextAlign, + flex: "initial", } satisfies Style, richListItemContent: { ...bodyText, - flex: 1, + flex: "initial", } satisfies Style, splitRow: { diff --git a/packages/pdf/src/templates/shared/rich-text.tsx b/packages/pdf/src/templates/shared/rich-text.tsx index 4062f0e18..75dbb34a1 100644 --- a/packages/pdf/src/templates/shared/rich-text.tsx +++ b/packages/pdf/src/templates/shared/rich-text.tsx @@ -61,10 +61,6 @@ export const RichText = ({ children }: RichTextProps) => { const { metadata, rtl } = useRender(); const rtlTextWrapStyle: Style | undefined = rtl ? { direction: "rtl", textAlign: "right" } : undefined; - const richListItemMarkerMargin: Style = { - marginLeft: rtl ? 4 : 0, - marginRight: rtl ? 0 : 4, - }; const boldStyle = useTemplateStyle("bold"); const linkStyle = useTemplateStyle("link"); const richParagraphStyle = useTemplateStyle("richParagraph"); @@ -123,7 +119,11 @@ export const RichText = ({ children }: RichTextProps) => { const contentItemStyles = itemStyles.map(stripRichTextVerticalMargins); const markerNode = ( - + {marker} ); @@ -153,10 +153,7 @@ export const RichText = ({ children }: RichTextProps) => { safeTextStyle, )} > - - {markerNode} - {children} - + {children} ); @@ -171,7 +168,7 @@ export const RichText = ({ children }: RichTextProps) => { getRichTextEdgeTrimStyle(element), )} > - {rtl ? [contentNode, markerNode] : contentNode} + {rtl ? [contentNode, markerNode] : [markerNode, contentNode]} ); },