I am trying to implement a custom WYSIWYG editor using a contenteditable
<div>
.
One of the major issues I am facing is the inconsistent way browsers handle ENTER keystroke (linebreaks). Chrome inserts <div>
, Firefox inserts <br>
and IE inserts <p>
. I was taking a look at TinyMCE and it has a configuration option called forced_root_block
. Setting forced_root_block
to div
actually works across all major browser. Does someone know how forced_root_block
option in TinyMCE is able to achieve it across browsers ?