You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a mobiledoc with a card that contains another mobiledoc, you cannot use the same renderer instance to render everything.
importMobiledocDomRendererfrom'mobiledoc-dom-renderer'constrenderer=newMobiledocDomRenderer.default()constcards={'some-card' : {},'some-other-card': {},'listicle-item-card': {display: {setup: function(element,options,env,payload){renderer.render(payload.mobiledoc,element,cards)// fixable by creating new MobiledocDomRenderer.default()}}}}constbodies=[{"version":"0.2.0","sections":[[],[[1,"p",[[[],0,"Opening text"]]]]]},{"version":"0.2.0","sections":[[],[[10,"listicle-item-card",{"title":"Item 1 title","primaryMedia":{},"mobiledoc":{"version":"0.2.0","sections":[[],[[1,"p",[[[],0,"Item 1 content"]]]]]}}]]]}]renderer.render(bodies[1],null,cards)// => Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent.
I also think the API would make more sense if you set your card definitions as part of the renderer constructor instead of passing them to the render method every time.
The text was updated successfully, but these errors were encountered:
If you have a mobiledoc with a card that contains another mobiledoc, you cannot use the same renderer instance to render everything.
I also think the API would make more sense if you set your card definitions as part of the renderer constructor instead of passing them to the render method every time.
The text was updated successfully, but these errors were encountered: