How to prevent CKEditor replacing spaces with  ?

后端 未结 3 1298
醉梦人生
醉梦人生 2021-02-14 20:24

I\'m facing an issue with CKEditor 4, I need to have an output without any html entity so I added config.entities = false; in my config, but some  

3条回答
  •  自闭症患者
    2021-02-14 21:07

    These entities:

    // Base HTML entities.
    var htmlbase = 'nbsp,gt,lt,amp';
    

    Are an exception. To get rid of them you can set basicEntities: false. But as docs mention this is an insecure setting. So if you only want to remove  , then I should just use regexp on output data (e.g. by adding listener for #getData) or, if you want to be more precise, add your own rule to htmlFilter just like entities plugin does here.

提交回复
热议问题