grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

[Bug]: Text component content not retrieved properly when using custom RTE

Open mcottret opened this issue 6 years ago • 2 comments

Version: 0.16.12

Are you able to reproduce the bug from the demo ?

[ ] Yes [x] No (it does not include a custom RTE)

What is the expected behavior ?

When using a custom RTE, the generated / exported code should correspond to the RTE's generated code

What is the current behavior ?

The generated code corresponds to the text component canvas element's innerHTML.

If we take CKEditor as an example: creating an empty anchor (as shown in screenshot 1) results in GJS' generated code containing the anchor flag's <img> element (cf screenshot 2), whereas CKEditor generates it properly (cf screenshot 3).

Proposed solution:

Does this look good to you ? As always, I'd be happy to open both PRs to fix this :) !

Are you able to attach screenshots, screencasts or a live demo ?

[x] Yes (attach)

Screenshot 1 (example canvas):

Screenshot 2020-07-24 at 4 05 06 PM

Screenshot 2 (GJS' generated code):

Screenshot 2020-07-24 at 4 05 17 PM

Screenshot 3 (CKEditor's generated code):

Screenshot 2020-07-24 at 5 22 57 PM

[ ] No

mcottret avatar Jul 24 '20 16:07 mcottret

Your solution seems to be correct 👍 a PR would be really helpful

artf avatar Aug 25 '20 15:08 artf

Awesome ! artf/grapesjs-plugin-ckeditor#39 & #2977 opened.

mcottret avatar Aug 26 '20 14:08 mcottret