Extra non-breaking paragraph tags in CKEditor

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
jafo66
Posts: 65
Joined: 06 Mar 2024, 04:42

Extra non-breaking paragraph tags in CKEditor

Post by jafo66 » 19 Jul 2024, 18:27

When editing a description the product, we are getting extra of these either between lists or at the end of the entry:

Code: Select all

<p<&nbsp;</p>
Even if we return to delete them either in the editor or the source, on save they get added back in. Is there a way to disable this "feature"? I've used the CKEditor before in other projects and this typically doesn't happen in those.

Thanks!

User avatar
aimeos
Administrator
Posts: 8238
Joined: 01 Jan 1970, 00:00

Re: Extra non-breaking paragraph tags in CKEditor

Post by aimeos » 22 Jul 2024, 07:53

This happens since CKEditor 5 and isn't configurable as far as we know. We try to remove the <p> tags at the beginning and the end here: https://github.com/aimeos/ai-admin-jqad ... xt.js#L215
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jafo66
Posts: 65
Joined: 06 Mar 2024, 04:42

Re: Extra non-breaking paragraph tags in CKEditor

Post by jafo66 » 23 Jul 2024, 21:23

Have you guys tried any of these configuration options?

Code: Select all

config.ignoreEmptyParagraph
config.fillEmptyBlocks
config.forceEnterMode
config.autoParagraph = false;

User avatar
aimeos
Administrator
Posts: 8238
Joined: 01 Jan 1970, 00:00

Re: Extra non-breaking paragraph tags in CKEditor

Post by aimeos » 24 Jul 2024, 10:08

Do you have a working configuration that prevents the <p> tags?

Also see: https://github.com/ckeditor/ckeditor5/issues/10448
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

jafo66
Posts: 65
Joined: 06 Mar 2024, 04:42

Re: Extra non-breaking paragraph tags in CKEditor

Post by jafo66 » 24 Jul 2024, 12:04

It looks like there may be a fix on the way: https://github.com/ckeditor/ckeditor5/pull/16770

I'm still messing with the configuration to see if we can remove those extra tags... some of the comments seem to indicate that it is possible under certain circumstances, but I'm not sure those would be "appropriate" for Aimeos.

Also, why not switch to the other editor used in the CMS functionality? That doesn't seem to be plagued with the extra <p> tags.

User avatar
aimeos
Administrator
Posts: 8238
Joined: 01 Jan 1970, 00:00

Re: Extra non-breaking paragraph tags in CKEditor

Post by aimeos » 25 Jul 2024, 10:07

CKEditor is currently the best option available.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply