Merge pull request #10230 from prssanna/text-editor-fix

fix: replace font tag with span in quill editor
This commit is contained in:
mergify[bot] 2020-05-05 12:39:36 +00:00 committed by GitHub
commit cc36d7d8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(/<font/g, '<span').replace(/<\/font>/g, '</span>');
}
}
CustomColor.blotName = "customColor";
CustomColor.tagName = "font";
Quill.register(CustomColor, true);
frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
make_wrapper() {
this._super();