Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent CKEditor5 from filtering out classes #135

Closed
jayhlee opened this issue Sep 7, 2023 · 1 comment
Closed

Prevent CKEditor5 from filtering out classes #135

jayhlee opened this issue Sep 7, 2023 · 1 comment
Labels

Comments

@jayhlee
Copy link

jayhlee commented Sep 7, 2023

Description

CKEditor5 filters out any classes applied to HTML elements in the Source Mode. I created an HTML Purifier config to prevent this, but the classes still get stripped out upon saving an entry.

{
   "HTML.Allowed": "ol[class],li"
}

Specifically, I'm trying to allow different classes to be applied to <ul> elements (e.g. class1, class2) without CKEditor5 stripping them out.

Additional info

  • Craft version: 4.5.3
  • PHP version: 8.0.13
  • Database driver & version: MariaDB 10.5.22
  • Plugins & versions: CKEditor 3.5.1
@jayhlee jayhlee added the bug label Sep 7, 2023
@brandonkelly
Copy link
Member

CKEditor itself is probably the one stripping the classes. The only way CKEditor will allow classes to be added to ol/ul/li elements is via the Styles feature.

Note that to style lists, you will need to ensure your CKEditor config’s “List Plugin” setting is set to DocumentList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants