How to save edited post when submitting form

What are you doing in the parsing function of the post content? You can do the same thing on the trigger of the standard update button to avoid data loss.

Please use the save_post hook to perform your function on the click of the standard update button. Please see the below link for documentation of save_post hook.
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post