Hi all,
I noticed that the CSS classes insert is supposed to add to anchor tags wrapped around images to turn those into color box-triggers stopped working. The culprit is CKeditor 4.2+'s new ACF feature: each plugin has to register what kind of data it will add, explicitly allowing it to be inserted.
Now this isn't a problem technically if you use the default CKeditor link plugin. But I use a different link plugin: LinkIt. LinkIt does not need classes to be added, so it doesn't register the need for it in the editor instance. This of course means, that CKeditor will strip any classes on anchor tags inserted with insertHtml().
I suggest that Insert should add the requirement for classes on anchor tags with CKeditor's ACF feature.
One dirty hack is to add this line
CKEDITOR.instances[Drupal.ckeditorActiveId].filter.allow('a[class,rel](*)');
before the call of .insertHtml() in insert.js around line 166 (current dev). This will essentially allow insert to add images with colorbox support and add any kind of classes to the anchor tag.
Comments
Comment #1
snater commentedJust having a look at the open bug tickets while working on D8 version of insert. This ticket was filed before #1956778: Ckeditor 4.1 ACF was fixed. I just tested D7 with Wysiwyg module and CKEditor: ACF seems to be disabled by default using CKEditor as text format editor, so there should be no action necessary to be taken on standard installations by now. Apart from that, in contrast to D8, I do not think it is appropriate to include CKEditor specific code in the D7 version as the editor is not as intertwined with core. I would push it to the responsibility of the user to configure ACF correctly when enabling it. Unless there are any objections, I will close this ticket.
Comment #2
snater commentedClosing as outdated as per above comment.