Follow-up to T199925 and T201472.
In T201472#4488623, @Esanders wrote:(…) I think ultimately we should move the paragraph cleanup into the command or action code:
If I type abc<newline>{| I expect to get <p>abc</p><table>..., which your previous patch achieves.
However if I type abc<newline> then choose Insert>Table, I don't get the benefits of the newline cleanup, which I think you should.
In general, taking any action to insert a block level element into an empty paragraph should destroy that paragraph.
In T201472#4488922, @DLynch wrote:@Esanders: Makes sense, and I agree on the general case. If you merge it, I can make a new task for fixing it up more permanently.