#9929: [Chrome 23] &nbsp; is created when deleting character and typing common space

It seems as &amp;nbsp; is a result of altering source by checkStartOfBlock()/checkEndOfBlock() using trim(). Changing order of checks in if() checkStartOfBlock()/checkEndOfBlock() are run only when necessary, not every time del/backspace is pressed.