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