I've got a fresh, standard install of Drupal 9.5-RC, and have added the Styles plugin to the Basic HTML text editor. The styles are set up like so:
p.test|Test P style
h2.test|Test H2 style
ul.test|Test UL style
ol.test|Test OL style
li.test|Test li style
blockquote.test|Test blockquote style
a.test|Test link style
If I select any text at all except an h2, the styles menu shows "Test P style" and "Test link style" available. Selecting "Test link style" applies an tag around the selected text, as well as the "test" class. I would expect that the "Test link style" option would only be available if I had selected text that is already linked.
If I select an h2, then the "Test H2 style" and "Test link style" options are available, and all others are disabled.
If I select a blockquote, then "Test blockquote style" is enabled along with the P and Link styles.
If I select the contents of a list, either OL or UL, only the P and Link styles are available -- not the OL, UL, or LI styles.
In CKE4, I would expect to have to solve these issues by adjusting my allowed HTML tags and attributes in the text format. But of course with CKE5, the allowed HTML field is read-only. It does seem to be automatically set up to allow the necessary tags and attributes:
<br> <p class="test"> <h2 class="test"> <h3> <h4> <h5> <h6> <ul class="test"> <ol class="test" reversed start> <li class="test"> <blockquote class="test"> <a class="test" href> <strong> <em> <drupal-media data-entity-type data-entity-uuid alt data-caption data-align>
I've tried also enabling the Source plugin and duplicating the tags but allowing any class, e.g. <ul class>
or <ul class="*">
, but to no avail.
Can anyone tell me what I've done wrong here?