diff --git a/app/editor/extensions/BlockMenu.tsx b/app/editor/extensions/BlockMenu.tsx index ead19219f2..57dd372ed4 100644 --- a/app/editor/extensions/BlockMenu.tsx +++ b/app/editor/extensions/BlockMenu.tsx @@ -80,6 +80,7 @@ export default class BlockMenuExtension extends Suggestion { $start.depth === 1 && state.selection.$from.pos === $start.pos + node.content.size && !!textContent && + node.childCount === 0 && node.textContent === "", text: this.options.dictionary.newLineEmpty, }, diff --git a/shared/editor/nodes/Doc.ts b/shared/editor/nodes/Doc.ts index b8c06552fd..cf8b669b29 100644 --- a/shared/editor/nodes/Doc.ts +++ b/shared/editor/nodes/Doc.ts @@ -18,11 +18,12 @@ export default class Doc extends Node { return [ new PlaceholderPlugin([ { - condition: ({ $start, parent, state, textContent }) => + condition: ({ $start, parent, node, state, textContent }) => textContent === "" && !isNull(parent) && parent.type === state.doc.type && parent.childCount === 1 && + node.childCount === 0 && $start.index($start.depth - 1) === 0, text: this.options.placeholder, },