From 0fea84f36287f70c6d2e0243673ca7081dc5a623 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 26 Aug 2026 21:24:26 +0000 Subject: [PATCH] Fix homepage spotlight teaser dropping italic formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SpotlightText's minimal Lexical converter only checked format bit 1 (bold) — bit 2 (italic) was silently ignored, so Tasse "Die Pause"'s italicized quote ("Nur noch schnell … Nein.") rendered as plain text on the homepage despite showing correctly in the admin's richText editor. --- app/components/ProductSpotlight.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/components/ProductSpotlight.tsx b/app/components/ProductSpotlight.tsx index d6fd9c8..782b3c8 100644 --- a/app/components/ProductSpotlight.tsx +++ b/app/components/ProductSpotlight.tsx @@ -21,8 +21,17 @@ type LexicalNode = { type: string; text?: string; format?: number; children?: Le function renderInline(node: LexicalNode, key: number): ReactNode { if (node.type === "text") { const textNode = node as LexicalTextNode; - const bold = typeof textNode.format === "number" && (textNode.format & 1) === 1; - return bold ? {textNode.text} : {textNode.text}; + const format = typeof textNode.format === "number" ? textNode.format : 0; + const bold = (format & 1) === 1; + // 2 = italic in Lexical's format bitmask — was silently dropped here, + // so italic spans (e.g. Tasse "Die Pause"'s spotlightText) rendered as + // plain text on the homepage despite showing correctly in the admin's + // richText editor. + const italic = (format & 2) === 2; + let el: ReactNode = textNode.text; + if (italic) el = {el}; + if (bold) el = {el}; + return {el}; } if (node.type === "linebreak") return
; // Any other inline node (link, etc.) — render its text children without