The general details are, while editing, after a period of time Dokuwiki automatically tells you that your 'lock for editing this page is about to expire'. Or something like that. This is all fine, but unfortunately when you are returned to the edit page, formatting changes are lost.
This is not standard Dokuwiki behavior. You should get this warning only if you leave a page open and are not working on it. You say you are "returned" to the edit page. When you get this warning, you should simply see a pop-up message window, but you are not moved away from your page and then "returned" to it.