我注意到,当从编辑器中提取数据时,它会过滤一些类和样式。我想使用与编辑器使用的完全相同的样式。
所以,我有两个问题需要解决。
我知道,在使用以前的ckeditor版本时,您可以使用以下方法来防止其过滤:
config.allowedContent = true;
发布于 2022-05-11 07:22:12
您可以在CKEditor 5中使用通用的HTML插件。
这就是我所使用的,可以根据我的需要启用一些特性。您可以自定义到您的实现。
ClassicEditor.create(richEditorElem, {
htmlSupport: {
allow: [
{
name: /^(div|ul|li|ol|a|button|p|h[1-6])$/,
classes: true,
styles: true
}
]
}
}).then( editor => {
}).catch( error => {
console.error( error );
});
https://stackoverflow.com/questions/62174468
复制相似问题