There is an editable div , in the sense of contentEditable . But when the user enters extra spaces, for example, then they then become special characters, and I cannot format the input. Screen attached. Please tell me how is treated
P.S. Tell me how to make a question, or at least tell me how these special characters of the space are called, and I will edit it.
const editable = document.querySelector('.editable'); const output = document.querySelector('.output'); editable.oninput = function () { output.textContent = this.textContent.replace( / +/g, ' '); } .editable { border:1px solid red; -webkit-user-modify: read-write; } <div class="editable">редактируемое</div> <div class="output">редактируемое</div> 
non-breaking spaceie not anon-breaking space- user33274