what worked for my project in tinymce v7+ is adding to the initialization: newline_behavior: 'block', then modifying The editor content to wrap it inside divs ( for the existing messages on the website) :
setup: function (editor) {
function wrapLinesInDivs(content) {
const lines = content.split(/<br\s*\/?>|\n/);
return lines.map(line => `<div>${line}</div>`).join('');
}
editor.on('init', function () {
// Get the initial content as HTML
let content = editor.getContent();
// Wrap each line in a div
let wrappedContent = wrapLinesInDivs(content);
// Set the modified content
editor.setContent(wrappedContent);
});
},