【问题标题】:Remove Automatically Added CSS Styles from CKEditor从 CKEditor 中删除自动添加的 CSS 样式
【发布时间】:2013-07-02 14:39:55
【问题描述】:

我的问题是 CK 编辑器正在从我的主样式表(在父页面中)检测和添加 css 类,这导致样式组合在很长的列表中显示不必要和不需要的样式。

我想删除自动添加到样式组合中的样式。

我希望 CK 编辑器只显示我在配置中定义的样式,而不显示默认或父样式。

我尝试了文档和 S.O. 中的各种技术,但似乎不起作用。

CKEDITOR.editorConfig = function (config) {

// I thought this is how you use the stylescombo plugin but it does nothing
config.stylesSet = 'custom:/ckeditor/styles.js';
config.stylesCombo_stylesSet = 'custom:/ckeditor/styles.js';

//I want only this style to display in the Styles combo.
//This does get added, but with all the other junk styles I do not want. 
config.stylesSet = [
{ name: 'Bolder', element: 'span', attributes: { style: 'font-weight:bolder'} }
];

};

我正在使用 CK Editor 4 和 stylescombo 插件。

【问题讨论】:

    标签: combobox styles ckeditor config


    【解决方案1】:

    显然您错误地将stylesheetparser 插件包含在您的构建中,因此这可能会有所帮助:

    config.removePlugins = 'stylesheetparser';
    

    或者你可以在没有这个插件的情况下构建一个新的 CKEditor 包。

    【讨论】:

    • 完美。谢谢。我认为该解析器对于 stylecombo 的工作是必要的。现在我看到它们是分开的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多