我用的是电传。我希望允许用户使用他们想要的所有内联样式。
但是当我使用CKEDITOR.config.allowedContent = true;
时,没有什么变化,并且ckeditor用[removed]
来更改style
名称。
以下是我想做的事:
config.js
CKEDITOR.editorConfig = function( config ) { };
CKEDITOR.config.allowedContent = true;
我也试过:
CKEDITOR.editorConfig = function( config ) {
CKEDITOR.config.allowedContent = true;
};
每次更改后,我都清除了缓存,但没有运气。当我进入
<p style="text-align: center;"><span style="color:#ff0000">this is for test</span></p>
其结果是:
<p [removed]="color:#ff0000">this is for test</span></p>
我读了很多文章,但还是没有运气。有什么建议吗?
发布于 2017-06-27 08:47:29
关于如何在CKEditor中启用附加标记的简单示例
CKEDITOR.replace( 'editor1', {
extraAllowedContent: 'style;*[id,rel](*){*}'
} );
extraAllowedContent在这里启用了元素,允许对所有已经允许的元素(*是通配符)附加两个属性(方括号中),允许对它们使用任何类名(*),并允许使用任何内联样式{*}。
允许样式标记(style type="text/css">...</style>)
config.extraAllowedContent = 'style';
允许任何类和任何内联样式。
config.extraAllowedContent = '*(*);*{*}';
我希望它会对你有用!!
发布于 2017-06-30 06:32:02
使用CKEditor配置文件config.js,将allowedContent属性设置为true
(因此完全禁用数据筛选):
CKEDITOR.editorConfig = function( config ) {
config.allowedContent = true;
};
https://stackoverflow.com/questions/44773797
复制相似问题