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

Percentage width set on an image is lost on saving #1334

Closed
JFox23 opened this issue Nov 20, 2023 · 0 comments
Closed

Percentage width set on an image is lost on saving #1334

JFox23 opened this issue Nov 20, 2023 · 0 comments
Labels
Milestone

Comments

@JFox23
Copy link
Contributor

JFox23 commented Nov 20, 2023

Describe the bug
After inserting an image and resizing it to 50% width, the style attribute on the component div is removed by core.cleanHTML().

To Reproduce
Steps to reproduce the behavior:

  1. Insert an image
  2. Use the image plugin controls to resize it to 50%
  3. Click on the save button
  4. Check textarea content for style attribute on the image component div (which is removed)

Expected behavior
I expect the style="width: 50%" attribute to remain intact. Or else loading the saved content in an editor instance will present an image with 100% width.

Desktop (please complete the following information):

  • OS: Mac OS X Ventura 13.6.1
  • Newest version of Firefox, Chroms or Safari (it happens in all browsers)

Additional context
I will provide a Pull request that adds the width attribute to _cleanStyleRegExp.format.

@JiHong88 JiHong88 added this to the 2.45.2 milestone Nov 29, 2023
@JiHong88 JiHong88 added the bug label Apr 14, 2024
JiHong88 added a commit that referenced this issue Apr 14, 2024
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