diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx index 792dbea5fe..b3834af65f 100644 --- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx +++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx @@ -629,7 +629,7 @@ export const SoupView = (props: SoupViewProps) => { when={!isComponentListView('search')} fallback={ -
+
{ @@ -15,6 +21,19 @@ export function singleLinePlugin() { editor.registerNodeTransform(LineBreakNode, (node) => { node.remove(); + }), + + // Programmatic inserts (snippets, paste) can nest block paragraphs inside + // the single root paragraph, which the root-child check above doesn't + // catch. Unwrap them so a nested block's inline content collapses onto the + // one line instead of rendering as extra rows. + editor.registerNodeTransform(ParagraphNode, (node) => { + const parent = node.getParent(); + if (!parent || $isRootNode(parent)) return; + for (const child of node.getChildren()) { + node.insertBefore(child); + } + node.remove(); }) ); };