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

attributesWhitelist does not handle class attribute in img tags #1244

Closed
spiff123 opened this issue May 23, 2023 · 3 comments
Closed

attributesWhitelist does not handle class attribute in img tags #1244

spiff123 opened this issue May 23, 2023 · 3 comments

Comments

@spiff123
Copy link

Describe the bug

This configuration:

attributesWhitelist: {
'img': 'class|style|data-.+'
},

Does not keep the class attribute in the img tag.

To Reproduce

  1. add a image
  2. goto source editor
  3. add class="myclass" to the img tag
  4. save

Expected behavior
It would be nice to have the class tag keept at the img tag even after save.
Use Case: PreviewImage in a template should be visible in editor and not visible in saved output.

Version: 2.44.12

  • Browser firefox
@JiHong88
Copy link
Owner

JiHong88 commented May 27, 2023

Classes must start with se- or __se__.
In the next version, the 'allowedClassNames' option will be added.

@spiff123
Copy link
Author

Thank you!

@JiHong88
Copy link
Owner

The 2.45.0 version has been updated.
Thank you.

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

No branches or pull requests

2 participants