mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-24 02:23:18 +08:00
Fix sending of emptystring class for Prosemirror decoration (#1004)
Prosemirror does not handle emptystring classes well for decorations when the decoration applies to a range that has other decorations. For example, both a spellchecking plugin and the tiptap highlighting plugin. Furthermore, there is no reason to emit empty decorations, so this change resolves that issue as well.
This commit is contained in:
parent
d2cf88fd16
commit
2466d3398f
@ -47,6 +47,11 @@ function getDecorations({ doc, name }) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.forEach(node => {
|
.forEach(node => {
|
||||||
|
if (node.classes.length === 0) {
|
||||||
|
// Do not emit empty decorations.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const decoration = Decoration.inline(node.from, node.to, {
|
const decoration = Decoration.inline(node.from, node.to, {
|
||||||
class: node.classes.join(' '),
|
class: node.classes.join(' '),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user