Question for table cellContent

Hi. We are using prosemirror. But we have a problem with tables. In the previous schema, it was done with cellContent:‘inline+’ of the table, We now have to change it to cellContent: ‘block+’. We want to know how to wrap the inline content in paragraphs when rendering the table.

That should just work, or maybe I don’t understand the question. If a cell contains a paragraph, then the rendering specified in the schema for paragraphs will be used to render it.

1 Like

Oh, my question was weird. I’m sorry.

We have already data containing inline+ content inside a table cell. When It change the cell schema to block+, I wonder if there is a way to convert and render existing inline content to block content.

In your database? Not automatically, but you should be able to write a function that takes the JSON (or HTML or whatever) representation of your document and updates it to conform to the schema change, and run that over your database, rather easily. (The DOM parser might in fact even automatically fix this for you, if you store the docs as HTML, but JSON input is not mangled or validated on parsing.)

1 Like