Bug #99477
closedEpic #99669: CKEditor5 Collection
Bug #99673: CKEditor5 Style Plugin
ckeditor5 html tag limitation on custom styles
0%
Description
We are using custom styles for the ckeditor, usually these can be limited to certain html elements:
https://ckeditor.com/docs/ckeditor5/latest/features/style.html
So in the style selector there should be only valid styles cklickable.
I have overhouled our used ckeditor configuration like:
style:
definitions:
- { name: "Internal Link", element: "a", classes: ['internal-link'] }
- { name: "External Link", element: "a", classes: ['external-link'] }
but this doesnt work, i can use every style on every element, and this produce another Problem:
If i use a link style like "internal-link" on a non A Tag (maybe a word inside a P tag, for Example: "Link").
- Selecting the Word: Link
- Setting the style: internal-link
This is the result:
<a class="internal-link">Link</a>
And this will break the Frontend (maybe another issue, i guess this should be fixed also if empty or broken A tags are rendered)
PHP Runtime Deprecation Notice: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/typo3/cms-core/Classes/LinkHandling/TypoLinkCodecService.php line 80
Files
Updated by Michael Kasten over 1 year ago
- File limited-stiles-by-html-tag-typo3-11.mp4 limited-stiles-by-html-tag-typo3-11.mp4 added
- File limited-stiles-by-html-tag-typo3-12.mp4 limited-stiles-by-html-tag-typo3-12.mp4 added
for a better understanding:
two short screencaptures to compare the behaviour bettween TYPO3 v11 and TYPO3 v12
Updated by Benjamin Franzke about 1 year ago
- Parent task changed from #99669 to #99673
Updated by Benjamin Franzke about 1 year ago
- Status changed from New to Closed
Thanks for your report, I can confirm this behaviour with v12.4.1
Something new here?
Yes, this issue has been fixed upstream in CKEditor5 v38 [1] which is included since v12.4.2 (see #100908)
https://github.com/ckeditor/ckeditor5/blob/v38.0.1/CHANGELOG.md#styles
Closing, please reopen if you still experience this issue.
Updated by Benjamin Franzke about 1 year ago
- Related to Task #100908: Update ckeditor5 to 38.0 added