Skip to content

Commit

Permalink
fix: check for empty text, fix #1292
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed May 13, 2021
1 parent a8ba313 commit 456f2b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-placeholder/src/placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 456f2b7

Please sign in to comment.