I’m still trying to wrap my head around the way Prosemirror is structured. Sorry if I’m going about this in completely the wrong manner.
I would like ProseMirror to recognize the structure that we have in our documents. They are currently represented as just two separate paragraph tags enclosed within a div with a special attribute and class.
Currently, when prosemirror parses this structure, it will turn the HTML it into the following:
<p>:Name:</p>
<p>Item</p>
It basically just strips out the enclosing div. I’m using the ProseMirror dino example as a starting point… My thought was that I needed to create a NodeSpec defining the enclosing div. The div will always have two paragraph tags within. Is there anything obvious that I’m doing incorrectly?
The code you pasted looks good, but it seems the parser isn’t matching that node type for some reason. Did you confirm that the schema you are using is the right one, and has that node type in it?
I see org_property is in the listing of nodes. Is there something special that I need to check on the org_property NodeType?
The constant dinoSchema is used directly after my console.log(dinoSchema) line to create and assign window.view, so I’m pretty sure the EditorView() is using the same schema with the correct NodeType.
You failed to specify a way in which the org_property node can actually be part of the document—it doesn’t appear in any content expression, and it’s not part of any group that does appear in content expressions.
Interesting… So just because I added a node to the schema doesn’t mean that it’s allowed within the document?
So it order for a org_property to appear, it must be in a content expression under another node in the schema or assigned a group which must also be used in another content expression?
Would it be correct to modify the doc node’s content expression to match a org_property node?
Your doc: {content: "(block | org_property)+"} text is just going to get ignored (doc doesn’t mean anything in a schema spec). You probably want to replace the doc node spec under nodes instead.