docs/solutions/best-practices/2026-05-09-lexical-paragraph-node-harvest-rows-need-dom-import-splitting.md
Lexical ParagraphNode tests look like a paragraph behavior bundle, but most
rows are Lexical class shape: constructor rules, JSON schema, DOM class output,
factory helpers, and type guards. The portable row is narrower: paragraph DOM
import should preserve valid alignment from CSS text-align and legacy
align, with CSS winning when both are present.
align in the example value type but did not
render it.<p> was too brittle because the editor can
retain an empty paragraph around pasted content.Split the source file before porting:
createDOM, updateDOM, factory, and type-guard
rows as Lexical API shape;The browser proof should assert the imported paragraphs by text and then inspect
their inline style.textAlign, not every rendered paragraph in the editor.
Slate owns paragraph alignment as editor data and rendering policy. The copied
behavior is not Lexical's ParagraphNode class; it is the user-visible result of
pasting standard paragraph HTML. Keeping the proof at the paste-html boundary
protects the actual behavior without baking in Lexical internals.