grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

[Bug] problem of styling with ckeditor(4)

Open hpruvot opened this issue 7 years ago • 6 comments

Hello @artf and all !

Thanks again for the amazing job !

I tried to implement ckeditor with grapesjs and it seems to work pretty much correctly but today I found something weird. I tried to screenshot this, let me know if it's not clear...

  • I select a text in white, it styles the span element, all fine. ezgif com-video-to-gif

  • I save my work, I reload the page

  • The white style has gone, hasn't been saved. And I can't change the color anymore (but bold works). The <span style="color:#ffffff;">HELLO</span> has turned into <span data-gjs-type="text" data-highlightable="1" id="iiklo" class="cke_editable cke_editable_inline cke_contents_ltr cke_show_borders" contenteditable="false" spellcheck="false">HELLO</span>

ezgif com-video-to-gif 1

Thanks a lot

hpruvot avatar Jan 25 '19 15:01 hpruvot

hey @hpruvot did you setup correctly the remote storage https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage I believe you're storing/loading the HTML instead of the JSON

artf avatar Jan 27 '19 18:01 artf

Hi @artf ! I'm storing and loading JSON though, to be able to re edit my templates after saving them, and it works just fine for the rest of my components... :/

hpruvot avatar Jan 28 '19 08:01 hpruvot

Hello again ! I found the solution, and my mistake... I was setting the option avoidInlineStyle to true, I removed it and now it works :)

hpruvot avatar Jan 29 '19 10:01 hpruvot

@hpruvot mmm I'm not sure this is the real problem, I mean, I use avoidInlineStyle every day and I'm not facing this issue. Moreover, soon or later, this option will be removed and the true behavior will be the only way to go (for a lot of reasons). The problem is, why your RTE content is parsed by the editor (<span style="color:#ffffff;">HELLO</span> should be stored as static and loaded as it is). I think the fact it works without avoidInlineStyle, it's just a fluke. Try to create a reproducible demo

artf avatar Jan 29 '19 13:01 artf

@artf you first thought was the right one ! I still double checked my code and it turned out that someone had changed my code and was indeed loading the HTML and not the JSON anymore... ¯_(ツ)_/¯ So sorry for this loss of time...

hpruvot avatar Jan 29 '19 14:01 hpruvot

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 30 '20 12:01 lock[bot]