Bug #99673
closedEpic #99669: CKEditor5 Collection
CKEditor5 Style Plugin
100%
Description
Style definition, this should add btn and a btn-primary to a link.
{
name: 'a',
classes: [ 'btn', 'btn-primary' ]
},
The following examples show the result of selecting the style and | represents the current cursor positon:
Text <a href="#">Example Text</a> Text
<a class="btn btn-primary"></a>Text <a href="#">Example Text</a> Text
Text <a href="#">Example| Text</a> Text
Text <a href="#">Example</a><a class="btn btn-primary"></a><a href="#"> Text</a> Text
Text |<a href="#">Example Text</a>| Text
Text |<a href="#" class="btn btn-primary">Example Text</a>| Text
Text <a href="#">Exam|ple| Text</a> Text
Text <a href="#">Exam</a><a class="btn btn-primary" href="#">ple</a><a href="#"> Text</a> Text
Text <a href="#">Example |Text|</a> Text
Text <a href="#">Example </a><a class="btn btn-primary" href="#">Text</a> Text
Text <a href="#">Example |Text</a> Text|
Text <a href="#">Example </a><a class="btn btn-primary" href="#">Text</a><a class="btn btn-primary"> Text</a>
As a user I expect that when the text selection is inside the link, that the class will be added to the existing element.
As a user I expect that when no text selection exists, only styles are available that can be inserted standalone.
As a user I expect to only see available styles for a selection
This seems not to be possible with CKEditor5 Styles plugin.
Possible Solution:
Write custom plugin for styles and replace existing styles plugin
https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-style
Updated by Benjamin Kott about 2 years ago
- Category set to RTE (rtehtmlarea + ckeditor)
Updated by Benjamin Franzke over 1 year ago
- Status changed from New to Accepted
The style plugin received a link-integration in CKEditor5 v38 [1].
It is included in TYPO3 since v12.4.2 (see #100908)
https://github.com/ckeditor/ckeditor5/blob/v38.0.1/CHANGELOG.md#styles
Updated by Benjamin Franzke over 1 year ago
As a user I expect that when the text selection is inside the link, that the class will be added to the existing element.
Solved upstream
As a user I expect that when no text selection exists, only styles are available that can be inserted standalone.
Solved upstream by marking those styles as deactived.
As a user I expect to only see available styles for a selection
This is not ideal, but not a reason to fork the plugin IMO. We are good with CKEditor only allowing sensible styles to be activated.
Now that ckeditor marks unavailable items as disabled, We could fix this via:
.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled {
display: none;
}
Updated by Gerrit Code Review over 1 year ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81269
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81269
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81281
Updated by Anonymous over 1 year ago
- Status changed from Under Review to Resolved
Applied in changeset d8c30a3fddfb4726d80ac76a2a5f1f33551c1d9f.