简体   繁体   English

如何删除ckeditor中的br标签?

[英]How to remove br tags in ckeditor?

How do I remove <br> tags from ckeditor? 如何从ckeditor中删除<br>标签? I am using standard feature of ck editor and code using in config file as given below 我正在使用ck编辑器的标准功能和在配置文件中使用的代码,如下所示

CKEDITOR.editorConfig = function( config ) {
       config.autoParagraph = false; 
   config.shiftEnterMode = CKEDITOR.ENTER_BR;
    config.shiftEnterMode = CKEDITOR.ENTER_DIV;

    // stops automatic insertion of <p> on focus

    config.allowedContent = false; // don't filter my data

};  

I would use CKEDITOR.config.disallowedContent 我会使用CKEDITOR.config.disallowedContent

Docs , more docs and small demo 文件更多文件小型示范

For example, this should work: 例如,这应该工作:

config.disallowedContent = 'br';

Hope it helps! 希望能帮助到你!

Edit: Here is another good doc page with examples 编辑: 是另一个带有示例的好文档页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM