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 use certain tags in CKEditor: The list tag, break tag, etc...
Can I define them & disable the other tags in CKEditor?
config. allowedContent = { $1: { // Use the ability to specify elements as an object. elements: CKEDITOR. dtd, attributes: true, styles: true, classes: true } }; config.
You need to press Shift + Enter in order to get just a <br> tag. This functionality is also 100% configurable. the SHIFT+ENTER works well thank you.
If you would like to use inline code formatting in your WYSIWYG editor, check out the basic text styles feature with its support for inline <code> element. The code block feature is enabled by default in the superbuild only. See the installation section to learn how to enable it in your editor.
There are some settings you can use. You define these settings editing the config.js file in the ckeditor's root directory. For example, if you want to be radical like me, you could put:
config.forcePasteAsPlainText = true;
If you want to restrict only certain tags exactly like you said, I found the setting bellow:
config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd';
The last will be done only when user execute the "remove format" command. More information: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.format_tags
Considering all the time, I think that you already have found your answer, but others can be helped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With