editorjs-text-color-plugin
editorjs-text-color-plugin copied to clipboard
Font color is not working properly with Font size And Font Family Plugins
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 ,
Sorry that this problem does not show up when I am using all the libraries mentioned above, with editor.js ^2.23.2".

It seems that we need more info about this issue
okay Thank you for quick response,can You Please share latest stable version of these plugins which have no conflict with each an other
I am using "vue-editor-js": "^2.0.2", Please share solution for vue editor
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>"}
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:
- The editorjs-inline-font-size-tool only exports "size" and "face" properties from editorjs HTML.
static get sanitize() {
return {
font: {
size: true,
face: true
},
};
}
- 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.