Incorrect image style css class in <img> element

Created on 13 August 2016, over 8 years ago
Updated 15 September 2023, over 1 year ago

After saving a node with an inserted image style named '480-wide' the css class attribute of the image becomes class="image-style-_80-wide" which should be class="image-style-480-wide"

Tested it with some other image styles as well and the first character of the image style is always replaced by an underscore.

edit: this underscore seems to be created when the $image array is rendered on line 108 in src/Plugin/Filter/FilterImageStyle.php:

$altered_html = \Drupal::service('renderer')->render($image);
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands erik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024