From 59b73f6f1f771ba78a0c902a85d246404fed4835 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 19 Jul 2026 21:37:35 +0000 Subject: [PATCH] fix(RichText): render real Lexical blockquote shape, not nested paragraphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QuoteNode's children are flat text/linebreak nodes directly (confirmed by reading @lexical/rich-text's source — insertNewAfter exits the quote into a new paragraph on Enter, it doesn't nest one inside). The "quote" case assumed nested paragraph children, which only happened to work for this session's own hand-authored seed JSON; any blockquote actually typed in the Payload admin editor rendered blank, since child.children was undefined on a plain text/linebreak node. Co-Authored-By: Claude Sonnet 5 --- app/components/RichText.tsx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/components/RichText.tsx b/app/components/RichText.tsx index 3ccea33..554750d 100644 --- a/app/components/RichText.tsx +++ b/app/components/RichText.tsx @@ -164,17 +164,22 @@ function renderNode(node: LexicalNode, key: string): ReactNode { className="absolute left-8 top-[2.1875rem] w-[8.5rem] h-[1.4375rem] object-cover pointer-events-none" />
-
- {(node.children ?? []).map((child, i) => ( -

- {renderChildren(child.children, `${key}-q-${i}`)} -

- ))} -
+ {/* Lexical's real QuoteNode holds flat text/linebreak children + directly, NOT nested paragraphs — pressing Enter inside a + blockquote in the editor exits it into a new paragraph + rather than adding a line within it (confirmed by reading + @lexical/rich-text's QuoteNode.insertNewAfter). An earlier + version of this case assumed nested-paragraph children, + which only happened to work for this session's own + hand-authored seed JSON — any blockquote actually typed in + the CMS (Shift+Enter for a soft line break) rendered blank, + since child.children was undefined on a plain text node. */} +

+ {renderChildren(node.children, key)} +

); default: