This looks like low-hanging fruit to me. Should be easy to fix.
I started working on this and I think it's not as easy as I initially thought. The problem is that we need to check all the children that will be put inside the new element to see if they are types that are allowed. The code isn't structured to make that easy. It still looks *relatively* straightforward, but I would no longer say easy.
Created attachment 19822 [details]
Comment on attachment 19822 [details]