fix: Empty placeholder shows up when no text but image in paragraph (#9593)

This commit is contained in:
Tom Moor authored and GitHub committed 2025-07-09 23:56:29 +00:00
1 parent ecf53866b5
commit cabae7a91e
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -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,
},
+2 -1
View File
@@ -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,
},