Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293174

Allow CKEditor styles for <drupal-media>

$
0
0

Problem/Motivation

The DrupalMedia plugin, added in 8.8.0, does not allow for CKEditor styles to applied to <drupal-media> elements.

Steps to reproduce

  1. Install with 'Standard' install profile.
  2. Enable Media and Media Library modules.
  3. Set default view mode for 'Image' media bundle to render an image element with no label.
  4. Add 'Insert from Media Library' and 'Styles' buttons to 'Basic HTML' toolbar.
  5. Add the following dropdown style: 'drupal-media.test-class|Test'.
  6. Save the filter format.
  7. Upload an image to the Media library and insert into a Basic Page node.
  8. Observe the only class on the <drupal-media> element is 'cke_widget_element'.
  9. Select the media element and use the Styles dropdown to add the 'test-class' class.
  10. Observe the only class on the <drupal-media> element remains 'cke_widget_element'.
  11. Switch to CKEditor’s source mode.
  12. Observe no class attributes.
  13. Manually add a 'test-class' class.
  14. Switch out of source mode.
  15. Observe the only class on the <drupal-media> element is 'cke_widget_element'.
  16. Switch back to source mode and observe the class has been removed.

Proposed resolution

Update the DrupalMedia plugin to allow for <drupal-media> elements to be assigned classes by the StylesCombo plugin.

Remaining tasks

  • Write patch
  • Update tests
  • Community review

User interface changes

<drupal-media> elements can now be assigned classes by the StylesCombo plugin.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.


Viewing all articles
Browse latest Browse all 293174

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>