As reported in
XWIKI-14791, there are 2 problems:
- The converted document content is not the current content of the editor, but the initial content of the document, from when it was initially loaded.
- After a syntax conversion is done, the content of the editor is not updated to reflect the newly converted content.
As the syntax conversion code uses the underlying textarea, we need to ensure that is updated with the editor's content once the editor loses focus (i.e. when clicking on the syntax changer select input).
Also, we need to make sure that any programmatic update of the underlying textarea (i.e. when the syntax conversions is done) is picked up by the editor and displayed to the user by refreshing the editor's content according to the textarea's content.