How to define allowed tags in CKEditor?

前端 未结 6 1433
忘了有多久
忘了有多久 2020-12-08 01:01
  • Sometimes users copy and paste text from different sources to CKEditor, but I want to restrict what tags they can copy to CKEditor.

  • I only need to u

6条回答
  •  执念已碎
    2020-12-08 02:00

    You can use the whitelist plugin to define in your configuration a list of elements and attributes that are allowed and deny anything else.

    It's basically the same solution presented by Paul Tomblin but it should be easier to handle more elements instead of copy lots of code and instead of blacklist it uses a whitelist so anything that isn't allowed is removed.

提交回复
热议问题