CKEditor Link 插件向渲染元素添加样式

CKEditor Link plugin add a style to rendered element

我正在尝试将以下属性添加到我在 link 插件对话框中点击“确定”后创建的元素

style="color:#1cb9b0"

不确定我要在哪里添加属性,它会在 onOk 函数中吗?目前

        onOk: function () {
            var data = {};

            // Collect data from fields.
            this.commitContent(data);

            if (!this._.selectedElements.length) {
                insertLinksIntoSelection(editor, data);
            } else {
                editLinksInSelection(editor, this._.selectedElements, data);

                delete this._.selectedElements;
            }
        },

任何提示或提示都会很棒。

在插入或编辑现有 link 时,我可以只在其中添加样式属性的建议是正确的。

insertLinksIntoSelectioneditLinksInSelection 函数中,我添加了以下行

attributes.set.style = "color: #1cb9b0;"; // add style attribute

工作完美。