Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Can SCEditor force paste as text

+4 votes
asked Jul 10, 2015 in Plugins by victorburgos
edited Jul 10, 2015 by victorburgos

Before I was using WYSIWYG editor on my site and I remember some where I changed a setting to make all pasted content text only.

Today I installed SCEditor, but I canĀ“t find how to do the same.

The problem is that some users copy and paste code from other sites and it comes with all html and looks bad.

Note: I'm using SCEditor not CKEditor

Thanks for your help.

3 Answers

+1 vote
answered Jul 11, 2015 by igael
selected Jul 13, 2015 by victorburgos
Best answer

then another answer for this editor. The previous one is still available for CkEditor

look for enablePasteFiltering  in www.sceditor.com/documentation/options/

enablePasteFiltering bool Defaults to false
With the BBCode plugin this will cause any HTML without a valid BBCode to be stripped.


commented Jul 13, 2015 by victorburgos
Thanks Leo, I will try the BBCode plugin.
0 votes
answered Jul 10, 2015 by igael

you must add a line to the ckeditor configuration file

open qa-wysiwyg-editor.php and just before :

                // Set language to Q2A site language, falling back to English if not available.
                "    defaultLanguage: 'en',",

insert this line

                "   forcePasteAsPlainText: true,",


commented Jul 10, 2015 by victorburgos
Hi Leo, thanks for your reply, just to let you know that I'm using SCEditor not CKEditor.
I've updated my question.
0 votes
answered Jul 15, 2015 by q2apro
As noted, it only works for BBcode not for HTML. And even with bbcode there is a bug.

I asked Sam, the sceditor developer to implement it for HTML as well and gave him some code suggestions. This is the recent state: https://github.com/samclarke/SCEditor/issues/334