editorjs-text-color-plugin icon indicating copy to clipboard operation
editorjs-text-color-plugin copied to clipboard

Font color is not working properly with Font size And Font Family Plugins

Open Abdul-develop opened this issue 3 years ago • 5 comments
trafficstars

Versions: "core-js": "~3.6.4", "editorjs-inline-font-family-tool": "^1.0.4", "editorjs-inline-font-size-tool": "^1.0.1", "editorjs-text-color-plugin": "^1.12.1", Issue: When Font size And Font Family Plugins are active then Font color is not passing color to json array during saving/storing process ,

Abdul-develop avatar Jul 18 '22 17:07 Abdul-develop

Sorry that this problem does not show up when I am using all the libraries mentioned above, with editor.js ^2.23.2". Screen Shot 2022-07-18 at 2 42 31 PM Screen Shot 2022-07-18 at 2 38 05 PM Screen Shot 2022-07-18 at 2 37 49 PM

It seems that we need more info about this issue

flaming-cl avatar Jul 18 '22 18:07 flaming-cl

okay Thank you for quick response,can You Please share latest stable version of these plugins which have no conflict with each an other

Abdul-develop avatar Jul 19 '22 05:07 Abdul-develop

I am using "vue-editor-js": "^2.0.2", Please share solution for vue editor

Abdul-develop avatar Jul 19 '22 20:07 Abdul-develop

I use

  "editorjs-inline-font-size-tool": "^1.0.1",
  "editorjs-text-color-plugin": "^1.13.1",

And it doesn't work Color: { class: ColorPlugin, config: { customPicker: true, type: 'text', }, }, fontSize: FontSize, "type":"paragraph","data":{"text":"<font size=\"5\">Text</font>"

But this works for me fontSize: FontSize, Color: { class: ColorPlugin, config: { customPicker: true, type: 'text', }, }, "type":"paragraph","data":{"text":"<font size=\"5\" color=\"#ff1300\">Text</font>"}

AntonMoldakov avatar Nov 07 '22 05:11 AntonMoldakov

I use

  "editorjs-inline-font-size-tool": "^1.0.1",
  "editorjs-text-color-plugin": "^1.13.1",

And it doesn't work Color: { class: ColorPlugin, config: { customPicker: true, type: 'text', }, }, fontSize: FontSize, "type":"paragraph","data":{"text":"<font size=\"5\">Text</font>"

But this works for me fontSize: FontSize, Color: { class: ColorPlugin, config: { customPicker: true, type: 'text', }, }, "type":"paragraph","data":{"text":"<font size=\"5\" color=\"#ff1300\">Text</font>"}

This is a workable solution, as the FONT tag output from editorjs-text-color-plugin was overwrote by editorjs-inline-font-size-tool.

Reasons in detail:

  1. The editorjs-inline-font-size-tool only exports "size" and "face" properties from editorjs HTML.
  static get sanitize() {
    return {
      font: {
        size: true,
        face: true
      },
    };
  }
  1. If you put the font size plugin after the color plugin, "color" property will be omitted by Editor.js when saving editor data.

Solution:

  • A temporary solution: Put the color plugin after the size plugin. So the overwriting issue will not happen.
  • A quick solution is to make a pull request to "editorjs-inline-font-size-tool" to allow more FONT properties exported by Editor.js.

But this may not be an effective solution. As there may be other plugins only exports it properties and ignores the others'.

  • A better solution is to make PR to Editor.js.

flaming-cl avatar Jan 24 '23 16:01 flaming-cl