Editing a link in ckeditor removes a set CSS class
A link being set in ckeditor may have several attriutes set, for example its title, the target and a set of pre-configured CSS classes.
However, editing such link renders the CSS selection with an empty value which removes the previously set class if the link gets updated.
#1 Updated by Gerrit Code Review 11 months ago
- Status changed from In Progress to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62426
#4 Updated by Andreas Fernandez 11 months ago
I've tested this with Bootstrap Package, reproducing it's pretty simple:
- Edit any content element that has a ckeditor
- Mark some text and put a link on it. In the Link Browser, select a CSS class from the selector and finally set the link
- Edit the link again, the previously selected class is not selected anymore
#5 Updated by Riccardo De Contardi 11 months ago
I tried with the yaml configuration taken from Bootstap package:
classesAnchor: page: class: 'link-page' type: 'page' folder: class: 'link-folder' type: 'folder' file: class: 'link-file' type: 'file' external: class: 'link-external' type: 'url' mail: class: 'link-mail' type: 'mail' buttons: link: properties: class: allowedClasses: 'link-arrow, link-page, link-folder, link-file, link-external, link-mail'
And actually, the behavior is the one you described. But I think that it is due to the
link-arrow class that has no "type" defined. Actually, if you remove it, then the selected class will stay.
That's the same behavior I experienced with my first attempt:
classesAnchor: internalLink: class: 'internal-link' type: 'page' internalLink2: class: 'internal-link-2' type: 'page' buttons: link: properties: class: allowedClasses: 'internal-link,internal-link-2'