小编j.s*_*ski的帖子

CKEditor 自动移除样式属性并添加 xss 属性 'Removed'

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)

html javascript php ckeditor

2
推荐指数
1
解决办法
4013
查看次数

标签 统计

ckeditor ×1

html ×1

javascript ×1

php ×1