JSFiddle - React, Tailwind, and code Playground

HTML

<div style="border:1px solid grey;height:20px;" id="paste_ff" type="text" contenteditable></div>

JavaScript

var pasteCatcher = document.getElementById('paste_ff');
document.getElementById('paste_ff').addEventListener('DOMSubtreeModified',function(){  
    if(pasteCatcher.children.length == 1){
        var text = pasteCatcher.innerHTML; console.log(text);   
        //text2  = text.replace(/\n/g, "___"); console.log(text);
        text2  = text.replace("<br>","____");
        if(text2 != text){
            pasteCatcher.innerHTML = text2;
            }
        }
    },false);