+ this.editor = wysiwyg.createPageEditorInstance(this.editContainer, editorContent);
+ });
+
+ let handlingFormSubmit = false;
+ this.input.form.addEventListener('submit', event => {
+ if (!this.editor) {
+ return;
+ }
+
+ if (!handlingFormSubmit) {
+ event.preventDefault();
+ handlingFormSubmit = true;
+ this.editor.getContentAsHtml().then(html => {
+ this.input.value = html;
+ this.input.form.submit();
+ });
+ } else {
+ handlingFormSubmit = false;
+ }