Closed (fixed)
Project:
Drupal core
Version:
10.1.x-dev
Component:
ckeditor5.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Dec 2022 at 15:39 UTC
Updated:
2 Oct 2024 at 08:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersAny chance you could also post a GIF of it working in CKEditor 4? And one for it failing in CKEditor 5? 🙏
Comment #3
wim leersThe CKEditor 5 team has been very consumed with making sure CKEditor 5 is equal or superior accessibility-wise compared to CKEditor 4, and that’s why they have not made as much progress on https://github.com/ckeditor/ckeditor5/issues?q=is%3Aissue+is%3Aopen+labe... as they were hoping.
The upstream bug report is https://github.com/ckeditor/ckeditor5/issues/11577 — please add a 👍-reaction to that GitHub issue to prioritize it higher for them 🙏
Comment #4
smustgrave commentedUsing the same text format as in the issue summary ul.test|Test
Using ckeditor4 text format

Using ckeditor5 text format

Comment #5
smustgrave commentedComment #6
smustgrave commentedComment #8
wim leers@Reinmar just confirmed that fixing this is scheduled for Q1 2023 👍
Postponing on that.
Comment #9
wim leersUpdating issue title to clarify this is no limited to lists — see #3324225-10: Support CKEditor 5's table properties and cell properties plugins in Full HTML.
Comment #10
acbramley commentedConfirming this bug after migrating from CKE4 -> CKE5 our styles on ul elements no longer work. They appear in the styles list but are greyed out and not clickable.
Comment #11
wim leersDiscussed this with @Reinmar from CKEditor 5!
This is one of their top priorities for this quarter. The fix should get merged in March, and will ship in their April 2–5 release. 👍
However, it's not a single fix: it cannot be fixed generically. It requires changes in many parts of CKEditor 5: for
<ul>the list plugin will have to be modified, for<table>the table plugin, and so on. So it's not known yet for which tags it will be fixed and for which ones it won't be — but expect a big leap forward in any case.Comment #12
wim leersDue to unforeseen challenges with the conversion of the CKEditor 5 codebase to TypeScript, this has been delayed.
Update directly from @Reinmar: expect the first PRs solving parts of this issue to land mid-May, and for most/all of this to be solved by Q2.
Comment #14
wim leersAs I reported almost a year ago at https://github.com/ckeditor/ckeditor5/issues/11709, this also applies to
<a>. Clarifying that here.Closing #3334617: CKEditor 5 Text Styles can be applied to any element even when a tag is specified as a duplicate.
As a temporary work-around for
<a>specifically, you could install @ChrisSnyder's https://www.drupal.org/project/ckeditor_link_styles module.Comment #17
wim leersCrediting the contributors of that issue.
Also note: #3347721: [Style] Warn the user about styles for unsupported elements would reduce the "WTF" factor — hoping to hear from the CKEditor team soon on that one! 🤞
Comment #18
bkosborneNote for
<a>, it seems to work fine. My defined styles for them can be applied to links I added. The problem is that it allows applying those styles to any element instead of just<a>. That wasn't super clear to me when reading thru this issueComment #19
wim leersGood point — clarified.
Comment #20
nomisgnos commentedThanks for keeping us up-to-date on this. I've hoped it was resolved by this month but I can see that it's not until mid May / Q2.
Comment #21
brulain commentedIf not solved in time, can we use CKE4 with D10 ?
Comment #22
wim leers@brulain Yes, you can use CKEditor 4 with Drupal 10 for another ~6 months. See https://www.drupal.org/docs/core-modules-and-themes/deprecated-and-obsol....
Comment #23
jwilson3<div>is also affected.div.alert.succcess|Success alert.<div class="alert success"> </div>and placed the cursor inside.<div>tag in the manually editable tags setting for CKEditor5.<div>in Source mode on the node edit form body field.Comment #24
jwilson3Upstream issue here:
#13341 Can't set the style on <div> using Styles dropdown
Please thumbs up that issue to help get it resolved faster and on maintainers radar.
Comment #25
jeremy.sloan commentedThere is also an issue with heading tags. They are disabled. Here is a list of styles I currently have.
Comment #26
jeremy.sloan commentedComment #27
jwilson3@jeremy.sloan:
That is an interesting point about the functional regression. In CKEditor 4 you could actually create an "empty" style for block-level tags like div, h2, h3 etc with no additional classes (eg
h2|Heading 2), and that would be enough to wrap the currently selected text in the associated tag.The way CKEditor 5 appears to work now is that you must first change the selected text from "Paragraph" to "Heading 2" (so that the H2 tag can be applied to the html source) before the Heading 2 jump-link style can be applied. This workaround obviates the need for the naked H2 style in the styles list.
Comment #29
wim leersClosed #3356593: [upstream] [Style] Support adding class attribute to table captions as a duplicate.
Quoting @Luke.Leber:
The good news: https://github.com/ckeditor/ckeditor5/issues/13777 was fixed on April 28! 😄
Comment #30
jeremy.sloan commented@jwilson3 ok that makes sense.
1) Put in you text first with headings plugin
2) Highlight text and apply styles. (Only styles that can be applied to the tag will be enabled)
Comment #31
frobWhats the timeline for rolling this into core? Will it be in the next version of 9 as well?
Comment #32
frobIs this really fixed by https://github.com/ckeditor/ckeditor5/issues/13777? It looks like that issue is only about table based elements.
Looks like we are still waiting on:
https://github.com/ckeditor/ckeditor5/issues/13341
https://github.com/ckeditor/ckeditor5/issues/11577
Both are needed to close this issue.
Comment #33
frobUpdated IS
Comment #34
wim leers@frob: I posted an update in the
#ckeditor5Drupal Slack channel after the meeting I had last Thursday with the CKEditor team. Sorry for not cross-posting here!Paraphrasing what I wrote there:
Stylewill ship in the next CKEditor 5 release, which will happen with 95% certainty on May 22 (twelve days from today!). See https://github.com/ckeditor/ckeditor5/issues/11574 for the list of things that is fixed (progress is still being made).10.1.xdespite it already being in alpha from the current37.1.0version to the next release.Styleproblems will be fixed in Drupal10.1.0! 🥳Rather than manually keeping track of a list of upstream issues here, I'd rather point to a single umbrella/meta upstream issue (so updated the IS), and then after the next release they will create a new umbrella/meta issue for the remaining ones.
I agree the clearest way forward then is for us on the downstream Drupal side to keep this issue open until
Styleworks on all commonly used HTML tags it's known to not work on.Drupal 9 will not get any CKEditor 5 updates, because Drupal 9.5.x is the last minor version for Drupal 9.
Comment #35
frobI am not quite sure I get this. If the fixes come before EOL of Drupal 9 why wouldn't 9.5 get the fixes? I thought 9.5 was a part of the CKE4-5 upgrade path for D10
Comment #36
wim leersVersion 38 has been released: #3361800: Update CKEditor 5 to 38.0.0.
@frob: because each CKEditor 5 update is a major release with some backwards compatibility breaks. That's why only new Drupal core minors get CKEditor 5 updates: there's too much disruption risk otherwise.
Comment #37
wim leers#3361800: Update CKEditor 5 to 38.0.0 is green: tests are passing. That means it's time for manual testing here! 🥳
We know for a fact that things are better in this release, so Drupal core will update to this version. But now we need to construct a list of the remaining bugs.
What remains
Currently there are 13 open issues for the
Stylepackage and 29 closed. Here are the 13 open issues:In the stabilization issue, 14 of the 20 issues are completed:
Impact of what remains to be fixed
I think the most impactful remaining bugs are:
<div>support: https://github.com/ckeditor/ckeditor5/issues/13341<table>support: https://github.com/ckeditor/ckeditor5/issues/11577Impact of what has already been fixed
<blockquote>support: https://github.com/ckeditor/ckeditor5/issues/11576<ul>+<ol>support: https://github.com/ckeditor/ckeditor5/issues/11590<a>support: https://github.com/ckeditor/ckeditor5/issues/11709Please confirm!
Please confirm the above breakdown in your manual tests 😊🙏
Comment #38
smustgrave commentedStill seems somewhat buggy.
I had 2 styles
On a basic page
Added a
ullist.The style dropdown updates correctly.
I can add a style to the
ultagGOOD
I press enter 3 times to get out of the list
Start a
ollist.It has the class for
ultag and I can't remove itI can add
olstyle fineSo should that one issue be moved to a follow up?
Comment #39
wim leers#38: I think that might be the already known bug described in https://github.com/ckeditor/ckeditor5/issues/11606. Asking @witeksocha for confirmation… 😊
Comment #40
smustgrave commentedAlso don’t think this bug is unique to lists. Seen it with other tags. If you press enter it doesn’t clear any settings
Comment #41
wim leersYep, that's exactly what #11606 upstream says. Makes it more likely that @witeksocha will confirm my hunch.
Comment #42
witeksochaI confirm this is the issue, I created a separate ticket for the list case https://github.com/ckeditor/ckeditor5/issues/14216. We will discuss it internally, and I will keep you posted.
Comment #43
gordon commented@frob FYI I have done some work on back porting v38 to Drupal 9.5. I now understand why it is not being back ported past Drupal 10.1
I have done the back port and it is working well enough to test this issue and confirm that when we upgrade to 10.1 will be able to move to CkEditor 5. However in v36 up (which were both in D10.1) there was a change in the plugin API which caused crashes of CKEditor 5. (See https://www.drupal.org/project/editor_advanced_link/issues/3350254) which I have found it also effects link it as well.
For testing of v38 i think this is fine, but I do not think this should be used in production.
Comment #44
smustgrave commentedThink a follow-up can be opened for tracking bug in #38, since it's not unique to ol, ol or any tag but whenever styles is used.
Not sure if Drupal wants to add some test coverage for this too, even though it was fixed upstream.
@wim leers thoughts?
Comment #45
wim leersTests
I personally don't think it makes sense to test every single one of these cases in Drupal if they're already being tested upstream. OTOH, it would make it crystal clear which precise cases are not yet working… 🤔
And in fact
\Drupal\Tests\ckeditor5\FunctionalJavascript\StyleTest::testStyleFunctionality()already exists for that very purpose. It currently contains for exampleSo: self-assigning to update (and expand) that test coverage.
To follow up or not
IMHO we should not create a follow-up but instead keep this issue open. Because it already has ~46 followers; we shouldn't ask all of them to follow another issue? OTOH, that issue could be more narrowly scoped, and we'd stop notifying people whose problems are already solved.
Thoughts?
Comment #46
wim leersRemaining known bugs have a new upstream "meta" issue: https://github.com/ckeditor/ckeditor5/issues/14274.
Comment #47
smustgrave commentedThat approach makes sense to me!
Comment #48
nterbogt commentedJust wanted to add a comment to say that the upstream epic that was being tracked appears to now be complete and was marked for release in v38.0.0 of CKEditor 5.
https://github.com/ckeditor/ckeditor5/issues/11574
Comment #49
wim leers#48: Indeed, see #37 through #46.
Comment #50
wim leersThanks to @Spokje in #3366633: Uncomment assertions in StyleTest related to https://github.com/ckeditor/ckeditor5/issues/11709, part of #45 is already addressed now 👍
Comment #51
wim leersMet with the CKEditor 5 team yesterday. I have GREAT news! 🥳
They made great progress on https://github.com/ckeditor/ckeditor5/issues/14274, with the first 3 being solved already:
👆 These will ship in a
38.xminor release, with no BC breaks, at the end of June! That will solve #38.They are already working hard on "Can't set the style on
<div>s) will happen first, the non-critical piece (being able to convert an existing element, for example a paragraph, into a<div class="something">by just choosing a style).It's unclear whether that'll be in the release at the end of June.
Comment #52
witeksochaMost likely 🤞, we haven't yet pinned the version for the next release yet.
Comment #53
wim leersThe fix for
<div>support landed upstream 46 minutes ago: https://github.com/ckeditor/ckeditor5/commit/4b44f58c8dd280cafaadb10b2d0... 🥳Comment #54
robloachDid some testing and was able to apply custom style classes to
<ul>and<ol>and<table>s without issue on the latest 10.1.x 🔥.... Unsure of<div>s though, don't have the plugin installed. We'll likely want to update to the latest CKEditor-dev for the fix Wim Leers linked.Comment #55
smustgrave commentedThink we should still include test cases so this functionality doesn't break on Drupal.
Comment #58
juanolalla commentedI have expanded the FunctionaJavascript/StyleTest.php coverage to test styles for ul, ol and table elements (https://git.drupalcode.org/project/drupal/-/merge_requests/4462/diffs?co...).
It's not possible to apply a style to a div element is not working yet as far as I know.
Comment #59
juanolalla commentedMy first commit failed because it worked in my 10.1.x version but fails
in the latest code, probably because of this ckeditor issue that has been fixed: https://github.com/ckeditor/ckeditor5/issues/11709in 10.0.x.Committing an attempt to fix it
Comment #60
juanolalla commentedUpdating to 10.1.x, that's why test was failing.
Comment #61
juanolalla commentedTests passing, this is ready for review
Comment #62
smustgrave commentedThe MR should actually point to 11.x as that’s the current development branch. Could that be updated please
Comment #63
smustgrave commentedUpdated title and IS to what is being fixed.
Removed follow up tag as issue appeared to be fixed upstream.
The test coverage appears to be good adding coverage for ul, ol, and table. But yes don't believe there is a core button for adding a div. There is a contrib https://www.drupal.org/project/ckeditor_div_manager but not ck5 version yet.
Think this is good to go.
Comment #64
sir_squall commentedHi,
What about Drupal 9, the bug is still there for the div?
Thanks
Comment #65
wim leers#64: this will not be backported to Drupal 9. That would break contributed modules.
The test coverage that @juanolalla added looks great! 🤩👏
I've added test coverage for
<a>. I'm working on test coverage for<div>. Will wrap that up in the next few days.Comment #66
sir_squall commentedOk fine, I will upgrade to 10 so, how can I apply the fix?
Comment #67
wim leersIt’s already fixed 😊 This issue is only adding test coverage!
Comment #68
sir_squall commentedOk because, I tried in Drupal 10.1.2 after having updated from 9.5 and when I save the styles in the ckeditor configuration, I got this error:
AssertionError: assert(NestedArray::keyExists($subform, $parts)) in assert() (line 892 of core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php).
I just tried to put that:
div.intertitre|intertitre
Thanks
Comment #69
sir_squall commentedHi Again,
I found a solution, when you put the styles you have to first click out of the field to have the ajax call to save the styles only after you can save the form.
So now I have the style correclty setup, but the stlye button in CKEditor is still disabled, I have put those styles:
div.texte|Texte
div.intertitre|Intertitre
div.exerge|Exerge
div.encadrer-titre|Encadrer Titre
div.encadrer-texte|Encadrer Texte
div.itw-question|ITW Question
div.itw-reponse|ITW Réponse
div.note-bas|Note Bas
But the button is not working, do I need to do something ? I have the Drupal 10.1.3-dev installed
Thanks
Comment #70
wim leers#68 + #69: that's related to #3262484: AJAX desync when quickly changing multiple form values in plugin settings vertical tab and #3265626: Changes to "Manually editable HTML tags" lost if form is submitted without triggering AJAX. It's unrelated to this issue.
Added the missing test coverage.
This is now ready.
Comment #71
smustgrave commentedSince we don't have a button that makes div I did have to manually add to the source. But confirmed I could add a style class to the div.
Comment #72
wim leersYep, and that's also what the test coverage does 👍😊
Thanks for the very fast review! 😳🥳
Comment #73
gstivanin commentedJust to know, are there any plans to return to having a behavior similar to ckeditor4 regarding styles, where it was not necessary to manually add the
<div>declaration to the source, just select the text and the<div>comes automatically with the style?Comment #74
witeksochaYes, we plan to have a similar behavior in CKE5. We are focusing on the most impacting bugs and I don't have an ETA yet.
Comment #75
wim leersIndeed. That's also what I explained in #51 ~2 months ago.
If there's at least one more person who posts a comment asking about this, I'll create an explicit issue on Drupal.org to track this upstream issue, that way Drupal users can get notified when Drupal updates to a version of CKEditor 5 that supports this 😊
Comment #76
sir_squall commentedHi,
Finally I have move from div to p, it work well. Quick question, how can we disable the "multiple style" behavior? The user need every time to click to remove the previous one, it's not really convenient like that.
Thanks
Comment #77
anybodyPlease note, that others desperately need that functionality. So perhaps that should be an option then to opt-in or out? (As separate feature request / follow-up discussion?)
Comment #78
wim leersAgreed with @Anybody. That's how it also worked in CKEditor 4 (try it for yourself at https://ckeditor.com/ckeditor-4/demo/), it just didn't show "Multiple styles" as the label.
I checked the docs (and demo) at https://ckeditor.com/docs/ckeditor5/latest/features/style.html, and there's nothing about this sort of "mutually exclusive style". But … there is a feature request for it: https://github.com/ckeditor/ckeditor5/issues/14206 — please add a reaction to that — that's how the CKEditor 5 team prioritizes issues based on their userbase's input! 😊
Comment #79
sir_squall commentedthanks a lot
Comment #81
lauriiiIt looks like we are still missing test coverage for the bug reported in #29. I think it would be great if we could expand the coverage to confirm that it has been addressed too.
Comment #82
wim leersAdded test coverage for #29 — good catch! 👍
Happy to report that this one too is working correctly 😄
Re-RTBC'ing because this is identical to the pattern established by all the other test cases — this is just one more test case.
Comment #84
lauriiiCommitted 2014af7 and pushed to 11.x. Since this is test only change, backported to 10.1.x. Thanks!
Comment #88
thatipudir commentedimage styles are not working on 9.5.10 cKEv5
exp:
img.m3|Margin
div , a tags are picking up
Comment #89
wim leers@thatipudir This only landed in
10.1.xand newer. Please update. 🙏One additional regression was reported:
<br class>. See #3398223: [upstream] [Style] [GHS] empty elements do not work: <br class>, <hr class>, <col class> etc.. The test coverage there builds on the test coverage that was introduced here 👍Comment #90
thatipudir commented@wim Leers - Issue on both 9.5.10 and 10.1.x. Thank you!
Created new issue here https://www.drupal.org/project/drupal/issues/3398786
Comment #91
frob@thatipudir I think it is safe to say that this will never work on Drupal 9.5
Comment #92
wim leersQuoting #51:
There now is a Drupal.org issue to track this remaining upstream non-critical piece: #3362451-9: [upstream] [Style] Allow CKEditor 5 to *create* a <h2 class="something"> directly (instead of first <h2>, then adding a class).
Comment #93
hoporr commentedPlease consider opening another issue for ck5 and div, as that problem also appears to be still unsolved, and it is slightly different than for "headline" because divs can wrap multiple elements.
UPDATE: Issue for "div" has since been created here: https://www.drupal.org/project/drupal/issues/3418322
Comment #94
sseto commenteda.a-button|Button doesn't seem to work. Anchor tags don't work anymore?
Comment #95
tigin öztürk commentedIs there any projection to solve the image class problem in CK Editor 5?
Comment #96
matthieuscarset commentedIt is still impossible to convert a
<p>into a<div>automatically by selecting from the Styles dropdown?And if yes, why are this issue and the upstream issue marked as closed ?