Thanks! But 3 issues here:
- It does not solve the
<div class="header">
issue - see long version. In short, the toDOM is a tree structure - I cannot break that down into fragments unless each DOM element become a node by it self - and then it would get really crazy…
Also, a few things I dumped into doing this as:
"big_object": <NodeSpec> {
group: "block",
content: "big_child_1 big_child_2",
toDOM: (node: Node) => ["div", { class: "big-object" }, 0],
parseDOM: [{ tag: "big-object", }]
},
"big_child_1": {
content: "inline+",
toDOM: (node: Node) => ["div", { class: "big-child-1" }, 0],
parseDOM: [{ tag: "big-child-1", }]
},
// ... same for 2
… with this content passed to the parser:
<big-object>
<p>whUt?</p>
</big-object>
… will match the p
into big_child_1
?!
-
So for above - how to make the schema really “strict”? I can understand
p
element does not yield and error unless I maybe create my own group (hope it then does?), but right now the it makes thep
become abig_child_1
- that’s a bit odd. -
Also the
inline+
for the big_child_1 object - that will insert a “dino” (i added dino from sample before img) into the inline content even though the dino is not the first inline object declared. How is the default forced content picked?