在 CK 编辑器中使用 class 名称设置插件工具栏图标

set plugin toolbar icon using class names in CK Editor

如何使用 class 名称(而不是使用图像 URL)设置插件 and/or 小部件工具栏按钮图标?

我发现了这个看似明显缺失的功能的破解方法:

editor.ui.addButton('MyButton', {
    //className: '...' // this only adds the classes to the parent container, not the icon span
    icon: '_ fa fa-scissors _'  // this hacks the existing classes and injects extra classes to the icon span
});

已使用 CK Editor v4.6.2 进行测试