liferay / liferay-ckeditor

Other
8 stars 49 forks source link

fix: [TS] LPS-139565 move inline styles for height/width to image attributes #191

Closed holatuwol closed 3 years ago

holatuwol commented 3 years ago

https://issues.liferay.com/browse/LPS-139565

Problem overview

In earlier versions of CKEditor, it set the height and width of a resized image as style properties. However, in later versions of CKEditor, it instead sets element attributes instead. As a result, any content created with the earlier version of CKEditor will run into issues in the newer versions of CKEditor.

Steps to reproduce (in Liferay)

  1. Navigate to the screen to create a new web content
  2. Access the WYSIWYG editor and upload an image to the document library and add it to the content
  3. Switch to the source view and add the style="height:100px; width:100px" attribute to the img tag to simulate content created in earlier versions of Liferay
  4. Publish the web content
  5. Edit the web content that you created
  6. Attempt to resize the image using either the dragresizer or by double-clicking on the image to load Image Properties

Expected behavior is that reloading the content in WYSIWYG view will result in an image that can be resized. Actual behavior is that the inline styling makes it impossible to resize the image.