Migrating from ckeditor 4 to ckeditor 5 does not produces HTML and Plain Text as expected plus causing emailing problems

Because ckeditor 4 is showing a EOL warning, I’m now trying to migrate to ckeditor 5. However, I ‘m having multiple problems with ckeditor 5. One problem is with on change and getting plain text from the HTML textbox. Other problems are with view source layout is narrow and changes how the HTML code looks from what I was expecting. Also, the saved HTML and Plain text is causing mail delivery error: ” message has lines too long for transport”

I had this JavaScript code in ckeditor 4:

'on: {
    change: function( evt ) {
     // Do somethign here
    ckText = CKEDITOR.instances.htmltext.getData();
var div = document.createElement("div");
div.innerHTML = ckText;
var cleanText = div.textContent || div.innerText || "";
document.getElementById("plaintext").value = cleanText;
    }
} '

It worked great!

but with ckeditor 5 with this code:

'  editor.model.document.on('change:data', () => {                    
  // Do somethign here   
 var div = document.createElement("div");
 div.innerHTML = editor.getData();
var cleanText = div.textContent || div.innerText || "";
document.getElementById("plaintext").value = cleanText;
          }
      }


ckeditor 5 removes all of the spacing between the paragraphs. Making it one continuous block.

The other problem is when I click on show source, I’m expecting to see HTML code similar to what I see when I’m coding a website, but what I’m seeing is new lines for every p and /p tag. It also changes the width for the textbox.

Plus, emails are being kicked backed as not deliverable because of error. I was testing the same email body that was originally created in ckeditor 4 that had no problem being delivered.