I completely forgot that I wrote this, and found it while seeing if anyone had written it before I wrote it again! I originally implemented the empty paragraph check in a half-assed way which didn't take into account paragraphs with non-text child elements -- this is now fixed, which should resolve the issues with other elements on the page disappearing.