Javascript CKEDITOR.config.allowedContent true don';行不通
我正在使用ckeditor。我想允许用户使用他们想要的所有内联样式 但是当我使用Javascript CKEDITOR.config.allowedContent true don';行不通,javascript,php,html,css,ckeditor,Javascript,Php,Html,Css,Ckeditor,我正在使用ckeditor。我想允许用户使用他们想要的所有内联样式 但是当我使用CKEDITOR.config.allowedContent=true,无任何更改,并且编辑器使用[删除]更改样式名称 以下是我试图做的: config.js CKEDITOR.editorConfig = function( config ) { }; CKEDITOR.config.allowedContent = true; 我还尝试: CKEDITOR.editorConfig = function( co
CKEDITOR.config.allowedContent=true代码>,无任何更改,并且编辑器使用[删除]
更改样式
名称
以下是我试图做的:
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>
这是测试用的
我读了很多文章,但还是不走运。有什么建议吗?关于如何在CKEditor中启用附加标记的简单示例
CKEDITOR.replace( 'editor1', {
extraAllowedContent: 'style;*[id,rel](*){*}'
} );
extraAllowedContent在此启用元素,允许所有(*是通配符)已允许的元素使用两个附加属性(方括号中),允许使用它们的任何类名(*),并允许使用任何内联样式{*}
要允许样式标记(style type=“text/css”>…)
:
允许任何类和任何内联样式
config.extraAllowedContent = '*(*);*{*}';
我希望它对你有用 使用属性设置为
true
的CKEditor配置文件(因此完全禁用数据过滤):
谢谢你的回答,但没有变化。我使用ckeditor工具栏添加内嵌css,如方向和字体颜色请尽量避免将代码作为答案,并尝试解释它的作用和原因。对于没有相关编码经验的人来说,您的代码可能并不明显。请编辑您的答案,包括感谢您的回答,我尝试了,没有变化。还是同一个问题您是否完全按照我编写的那样尝试过,比如
config.allowedContent=true代码>?前面没有CKEDITOR.
向导,tnx回复,但仍然没有更改,ckeditor仍然删除样式attribute@Wizard,tnx以获取答复,但仍然没有更改,ckeditor仍然删除样式属性
config.extraAllowedContent = '*(*);*{*}';
CKEDITOR.editorConfig = function( config ) {
config.allowedContent = true;
};