Jump to content

Bug: Adding image with no alignment adds invalid class to image


Lance O.
 Share

Recommended Posts

If I upload an image to a multiple images field, then add the image to the body field of the same page and select No alignment, the following class is assigned to the image ("No Alignment"):
 
<p><img class="No Alignment" src="/site/assets/files/1001/image.png" alt="Example" /></p> 

This seems like a bug since it registers as two separate classes ("No" and "Alignment"). Can this be changed to a single (lowercase) class that doesn't include a space (or not included altogether, since it assumes the image is inline)?

Link to comment
Share on other sites

I'm not able to duplicate this one. Anyone else seeing it? I've tried on both PW 2.3.0 stable and 2.3.5 dev, with both TinyMCE and CKEditor. "No Alignment" is not intended to be a CSS class. It sounds like somehow the option label is ending up as the CSS class in your case rather than the option value. 

Link to comment
Share on other sites

When you are in the modal and can select an alignment, first select something other than the No Alignment option. Then, immediately change your selection to No Alignment and insert the image. The No Alignment class appears in the code.

So it looks like it only appears when the alignment option is changed to No Alignment from one of the other options.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...