No, there isn’t. Meld’s text filters don’t support removing line breaks for annoying technical reasons. The “trim blank line differences” option on the same preference page will work around that limitation for some use cases, but it won’t do anything for either of the examples you’ve provided.