According to HTML 5, the only permitted content inside a p element is phrasing content. However, <math display="block"> generates a div placed inside of a p element, where a div is flow content.
This mode should remove the p that occurs prior to the div, as well as the closing tag.