Fix bug: new line does not have previous line formatting on firefox

* new line does not have previous line formatting on firefox 
* select with range normalize
* Fixed #573