Skip to content

Commit

Permalink
fix(core): account for node attrs when checking if content is equal
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 committed Jul 22, 2024
1 parent 4e5b2d8 commit 35682d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lovely-cougars-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/core": patch
---

This fixes a bug with the placeholder extension where a heading level other than the default was not considered empty, when comparing node contents, we need to consider that the node attributes are carried over for a fair comparison of content instead of attribute values
2 changes: 1 addition & 1 deletion packages/core/src/helpers/isNodeEmpty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Node as ProseMirrorNode } from '@tiptap/pm/model'

export function isNodeEmpty(node: ProseMirrorNode): boolean {
const defaultContent = node.type.createAndFill()
const defaultContent = node.type.createAndFill(node.attrs)

if (!defaultContent) {
return false
Expand Down

0 comments on commit 35682d1

Please sign in to comment.