Fix placeholder not displayed in table and lists
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -27,6 +27,17 @@ export const PlaceholderExtension = Extension.create({
|
|||||||
if (node.type.name !== "paragraph") return DecorationSet.empty;
|
if (node.type.name !== "paragraph") return DecorationSet.empty;
|
||||||
if (node.content.size !== 0) 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);
|
const pos = $pos.before($pos.depth);
|
||||||
|
|
||||||
return DecorationSet.create(state.doc, [
|
return DecorationSet.create(state.doc, [
|
||||||
|
|||||||
Reference in New Issue
Block a user