Let's read a contenteditable element:
<span id="myinput" contenteditable="true">This is editable.<br>Yes it is.</span>
just after you added manually two white-spaces at the end of the text.
I get :
textContent
=>"This is editable.Yes it is. "
innerText
=>undefined
innerHTML
=>"This is editable.<br>Yes it is. "
jQuery
.text()
=> same thantextContent
i.e. line breaks are lost
How to get "This is editable.\n Yes it is. "
? (Of course some regex could work on innerHTML, but that's dirty : maybe there are lots of things that I should parse...)