GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.94k stars 393 forks source link

Hot to keep style attributes on save. #575

Open bence-palkovics opened 2 years ago

bence-palkovics commented 2 years ago

Hi, I'm trying to use the style attribute to store modifications like color or font-size change, however when I save the project, these attributes are erased. How could I keep these attributes on save?

Here is a code snippet, used in a custom tool:

SelectColor();
element._domElement.style.color = selectedColor;
element.addCSSClass(this.className);
callback(true);
return this.dispatchEditorEvent('tool-applied', toolDetail);