Disallow inline images

@jneander We have normalization rules that opportunistically lift the images to be block level but we also skip parsing textblocks if they have a direct child that contains an image. These two changes seem to work across the board and don’t cause data loss, but under certain conditions when pasting you could lose textblock level attributes. For example

<p style="text-align:center">Some<img src="someImage.jpg" />content</p>

In this structure, you would skip parsing the “p” tag because you would notice that it has a direct child that is an image. “Some” and “content” would be auto wrapped in a text block because they are text nodes but you would lose the ability to parse the text-align style as an attribute.

I think ideally at this point, this case would be handled inside of Prosemirror. Specifically I believe this comment by Marijn is correct answer given no technical constraints.

1 Like