How to deal with with nodes being dropped during parsing

It should be possible to make the DOM parser smarter about this case, I guess—if a node that can only be paced ‘above’ the current context, it could temporarily exit that context and then, if there’s more content that fits after the node, restore it. But that code currently doesn’t exist, and the parser is already somewhat subtle and complicated as it is, so adding that functionality wouldn’t be trivial.

“Solid” currently means ‘this context corresponds to an actual parsed node’ (as opposed to a made-up parent node to make something fit). Even if you somehow get it to be false in that situation, you’d still have an issue with returning to the original context after the image node—paragraphs are likely your default textblock, but if you had, say, a code block or header around the image, the text after it would end up in a plain paragraph. The current code leans towards preserving successfully parsed context vs forcing a place for a new node.