Skip to content
Snippets Groups Projects
Commit f5e0c106 authored by rhenck's avatar rhenck
Browse files

[editor] Fix TextEditor bullet list extension

ProseMirror seems not to allow editing text nodes. Since a text node can 
be a child of an element being applied the bullet list to, it fails for 
that text element. It seems it was workingly correctly before. The error 
seen on the console was inconsequential since we don't want to apply 
attributes to pure text nodes anyway. This change at least removes this 
error.
parent b497f652
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,9 @@ export const bulletListExtension = BulletList.extend({
const node = tr?.doc?.nodeAt(pos);
if (node) {
const nodeAttrs = { ...node.attrs, listStyle: newStyle };
return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks);
if (node.type.name !== 'text') {
return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks);
}
}
return tr;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment