From b39750af1fa52efdccd06ed6105ccbd63be0cf58 Mon Sep 17 00:00:00 2001 From: prssanna Date: Tue, 5 May 2020 11:52:23 +0530 Subject: [PATCH] fix: replace font tag with span in quill editor --- .../js/frappe/form/controls/text_editor.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frappe/public/js/frappe/form/controls/text_editor.js b/frappe/public/js/frappe/form/controls/text_editor.js index 4e18b081cc..5e73889490 100644 --- a/frappe/public/js/frappe/form/controls/text_editor.js +++ b/frappe/public/js/frappe/form/controls/text_editor.js @@ -54,6 +54,22 @@ Quill.register(FontStyle, true); Quill.register(AlignStyle, true); Quill.register(DirectionStyle, true); +// replace font tag with span +const Inline = Quill.import('blots/inline'); + +class CustomColor extends Inline { + constructor(domNode, value) { + super(domNode, value); + this.domNode.style.color = this.domNode.color; + domNode.outerHTML = this.domNode.outerHTML.replace(//g, ''); + } +} + +CustomColor.blotName = "customColor"; +CustomColor.tagName = "font"; + +Quill.register(CustomColor, true); + frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({ make_wrapper() { this._super();