Ckeditor 将范围更改为字体编辑器颜色按钮
Ckeditor在从编辑器更改颜色后向元素添加Ckeditor 将范围更改为字体编辑器颜色按钮,ckeditor,Ckeditor,Ckeditor在从编辑器更改颜色后向元素添加标记 我需要将标签更改为 我查看了ckeditor.js中的代码,但没有找到任何关于颜色的信息来切换span到font在ckeditor config.js文件中添加这两行 config.colorButton_backStyle.element = 'font'; config.colorButton_foreStyle.element = 'font'; 你现在可以做你能做的更多了 这是我的ckeditor config.js,其中有两
标记
我需要将标签更改为
我查看了ckeditor.js中的代码,但没有找到任何关于颜色的信息来切换span到font在ckeditor config.js文件中添加这两行
config.colorButton_backStyle.element = 'font';
config.colorButton_foreStyle.element = 'font';
你现在可以做你能做的更多了
这是我的ckeditor config.js,其中有两行:
CKEDITOR.editorConfig = function (config) {
config.toolbarGroups = [
{name: 'document', groups: ['mode', 'document', 'doctools']},
{name: 'clipboard', groups: ['clipboard', 'undo']},
{name: 'editing', groups: ['find', 'selection', 'spellchecker']},
{name: 'forms'},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'bidi']},
{name: 'align'},
'/',
{name: 'links'},
{name: 'insert'},
{name: 'styles'},
{name: 'colors'},
{name: 'tools'},
{name: 'others'}
];
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Subscript,Superscript';
config.removeDialogTabs = 'link:advanced';
config.extraPlugins = 'font,justify,keyword,colorbutton,dropoff,colordialog';
config.skin = 'heisenberg';
config.language = 'pt-br';
config.disallowedContent = "img,script,style";
config.colorButton_enableMore = true;
// it change span tag to font tag, mental note, plugin must already been loaded.
config.colorButton_backStyle.element = 'font';
config.colorButton_foreStyle.element = 'font';
};
您可以遍历DOM并删除
,然后添加正确的标记