I'm trying to obtain the html code from user input using a div contenteditable. Don't worry about HTML code injection, that is taken care of.
Anyway, when i enter
bla1
bla2
bla3
the output, i believe, should be
bla1<br>bla2<br>bla3
However, what i am getting is
bla1<div>bla2</div><div>bla3</div>
Sometimes it even becomes
bla1<div>bla2</div><div>bla3<br></div>
What is this??? What am i doing wrong here?
Example of the code: http://jsfiddle.net/ohhjjevf/3/