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:
@@ -47,6 +47,11 @@ function getDecorations({ doc, name }) {
|
||||
}
|
||||
})
|
||||
.forEach(node => {
|
||||
if (node.classes.length === 0) {
|
||||
// Do not emit empty decorations.
|
||||
return
|
||||
}
|
||||
|
||||
const decoration = Decoration.inline(node.from, node.to, {
|
||||
class: node.classes.join(' '),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user