From 8fa77c8282b10e7de36863c4df6583a62a55354c Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 22 Oct 2026 00:01:10 +0200 Subject: [PATCH] fix: PowerPoint preview centres titles the file aligns left (#32876) In the PowerPoint preview, a title or subtitle that the file sets to left alignment was drawn centred, the same as one with no alignment at all. Decks made by python-pptx and most deck generators set the alignment on every paragraph, so their left-aligned title slides all came out centred. The preview now keeps a title the file aligns left on the left, and only centres titles and subtitles that leave the alignment open. Fixes #32873 --- src/lib/utils/pptxToHtml.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/utils/pptxToHtml.ts b/src/lib/utils/pptxToHtml.ts index afe718ddc6..542bcd8e91 100644 --- a/src/lib/utils/pptxToHtml.ts +++ b/src/lib/utils/pptxToHtml.ts @@ -257,6 +257,8 @@ const paragraphAlign = ( const align = para.getElementsByTagName('a:pPr')[0]?.getAttribute('algn'); if (align === 'ctr') return 'center'; if (align === 'r') return 'right'; + // l and the justified modes the preview cannot draw render from the left + if (align) return 'left'; const type = normalizePlaceholderType(ph?.type ?? ''); if (type === 'title' || type === 'subTitle') return 'center';