fix: check for empty text, fix #1292

This commit is contained in:
Philipp Kühn
2021-05-13 21:25:33 +02:00
parent a8ba313255
commit 456f2b702b

View File

@@ -40,7 +40,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
doc.descendants((node, pos) => {
const hasAnchor = anchor >= pos && anchor <= (pos + node.nodeSize)
const isEmpty = !node.isLeaf && isNodeEmpty(node)
const isEmpty = !node.isLeaf && !node.textContent
if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
const classes = [this.options.emptyNodeClass]