diff --git a/packages/tiptap-extensions/src/plugins/Highlight.js b/packages/tiptap-extensions/src/plugins/Highlight.js index f66b0d027..0f3528cc3 100644 --- a/packages/tiptap-extensions/src/plugins/Highlight.js +++ b/packages/tiptap-extensions/src/plugins/Highlight.js @@ -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(' '), })