CodeMirror adding empty <p> tags in TinyMCE

I’m using CodeMirror Version 5.43.0 with TinyMCE Version 4.9.2. After editing the content with CodeMirror an empty ‘p’ tag is always pre- or appended to the content. Is there a solution or a workaround for this problem?

This is not CodeMirror-related (CodeMirror just takes the text it is given and doesn’t add content)