diff --git a/frappe/public/js/frappe/form/controls/text_editor.js b/frappe/public/js/frappe/form/controls/text_editor.js index 3fe0b60ae0..5881e52d74 100644 --- a/frappe/public/js/frappe/form/controls/text_editor.js +++ b/frappe/public/js/frappe/form/controls/text_editor.js @@ -201,9 +201,14 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({ // hack to retain space sequence. value = value.replace(/(\s)(\s)/g, '  '); - if (!$(value).find('.ql-editor').length) { + try { + if (!$(value).find('.ql-editor').length) { + value = `
${value}
`; + } + } catch(e) { value = `
${value}
`; } + return value; },