Changed build result in v1.0.3
bodia-uz opened this issue · 3 comments
bodia-uz commented
Build result changed in v1.0.3
code:
u('blockquote', {
"type": "root",
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "x"
}
]
}
]
})
v1.0.2:
{"type":"blockquote","children":[{"type":"paragraph","children":[{"type":"text","value":"x"}]}]}
v1.0.3
{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"x"}]}]}
PS: root type is passed from code like this:
u('blockquote', remark().parse('x'))
wooorm commented
Hmm, what you’re doing here is weird! A lot of stuff is going on.
- You’re passing a root node “as a child” of a blockquote. That’s not valid.
rootshould never be in another node - You’re passing a node (the root) as
props, so all the props of of the root are extended onto the blockquote. If you would like to add a node as a child, you should use a children array:u('blockquote', remark().parse('x').children)
It’s an interesting case 🤔
bodia-uz commented
Thanks for the clarification.
Works ok, with suggested updates.
wooorm commented
Good, I’m glad!