Fix Problem with text selection ending outside the container div

https://github.com/daviferreira/medium-editor/issues/88