mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
fix(core): account for node attrs when checking if content is equal
This commit is contained in:
parent
4e5b2d89cd
commit
35682d1322
5
.changeset/lovely-cougars-care.md
Normal file
5
.changeset/lovely-cougars-care.md
Normal file
@ -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
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user