Fix placeholder not displayed in table and lists

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-24 13:07:18 +04:00
parent fc0c71ea7d
commit 3afdb0b5b8

View File

@@ -27,6 +27,17 @@ export const PlaceholderExtension = Extension.create({
if (node.type.name !== "paragraph") return DecorationSet.empty;
if (node.content.size !== 0) return DecorationSet.empty;
if ($pos.depth >= 2) {
const parentName = $pos.node($pos.depth - 1).type.name;
if (
parentName === "listItem"
|| parentName === "tableCell"
|| parentName === "tableHeader"
) {
return DecorationSet.empty;
}
}
const pos = $pos.before($pos.depth);
return DecorationSet.create(state.doc, [