The table missed the tbody and colgroup when I wrap the table with a nodeView which have dom
and contentDOM
. The contentDOM is created by DOMSerializer
serializeNode, and it has colgroup and tbody. However, the table missed colgroup and tbody after rendered by the node view. I find colgroup and tbody are removed by renderDescs
function. I don’t knowt this is the bug of renderDescs or I am short of some important information of Prosemirror.
My Table Schame like this:
table = {
...tableNodes.table,
attrs: {
colwidth: { default: [] },
},
toDOM: () => {
return ['table', attrs, ['colgroup', ...colwidth.map((n) => ['col', { width: `${n}pt` }])], ['tbody', 0]];
},
};