Fix for position of cursor in html mode.