瀏覽代碼

feat: catch exceptions on tokenizing values in get_value

version-14
Shivam Mishra 5 年之前
父節點
當前提交
23975d5a70
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      frappe/public/js/frappe/form/controls/text_editor.js

+ 6
- 1
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. // hack to retain space sequence.
value = value.replace(/(\s)(\s)/g, '  '); 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>`; value = `<div class="ql-editor read-mode">${value}</div>`;
} }

return value; return value;
}, },




Loading…
取消
儲存