Fixed disappearing content in markdown mode.

This fixes the issue of disappearing content, while using the markdown features

Replication steps:
1. Put your cursor at the end of the second paragraph in index.html,
after "... an empty value to the input field."
2. Press enter, and then add some markdown i.e. "1. " or "# "