There are two ways I can think of to do this:
- Redirect back to the edit page with the modified content. Display an alert with the error message.
- Instead of submiting the form with the tradtional post, use JavaScript to save the changes. Once the client side confirms that the page was saved, only then redirect to displaying the page.
I think we could also save the edited page in localstorage, so if the browser crashes, the changes are not lost.