CKEditor 会自动删除样式属性并添加 xss 属性“已删除”,就像我在元素中放置样式属性一样:
<div class="text-center" style="text-align: center;">Test Heading</div>
Run Code Online (Sandbox Code Playgroud)
保存后我得到以下输出:
<div class="text-center" xss="removed">Test Heading</div>
Run Code Online (Sandbox Code Playgroud)
我的配置是:
var toolbar_custom=[
{ name: 'document', items: [ 'Source' ] },
{ name: 'editing', items: [ 'Scayt' ] },
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
{ name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'] },
{ name: 'insert', items: [ 'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' …
Run Code Online (Sandbox Code Playgroud)