diff --git a/frappe/public/js/frappe/form/controls/base_input.js b/frappe/public/js/frappe/form/controls/base_input.js index 365ff364d5..e0a572d476 100644 --- a/frappe/public/js/frappe/form/controls/base_input.js +++ b/frappe/public/js/frappe/form/controls/base_input.js @@ -119,9 +119,12 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({ } else { value = this.value || value; } - this.disp_area && $(this.disp_area) - .html(frappe.format(value, this.df, {no_icon:true, inline:true}, - this.doc || (this.frm && this.frm.doc))); + if (this.df.fieldtype === 'Data') { + value = frappe.utils.escape_html(value); + } + let doc = this.doc || (this.frm && this.frm.doc); + let display_value = frappe.format(value, this.df, {no_icon:true, inline:true}, doc); + this.disp_area && $(this.disp_area).html(display_value); }, bind_change_event: function() { @@ -184,4 +187,4 @@ frappe.ui.form.ControlInput = frappe.ui.form.Control.extend({ $(this.disp_area).toggleClass("bold", !!(this.df.bold || this.df.reqd)); } } -}); \ No newline at end of file +});