Browse Source

feat: catch exceptions on tokenizing values in get_value

version-14
Shivam Mishra 5 years ago
parent
commit
23975d5a70
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      frappe/public/js/frappe/form/controls/text_editor.js

+ 6
- 1
frappe/public/js/frappe/form/controls/text_editor.js View File

@@ -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 = `<div class="ql-editor read-mode">${value}</div>`;
}
} catch(e) {
value = `<div class="ql-editor read-mode">${value}</div>`;
}

return value;
},



Loading…
Cancel
Save