2

Im making a CMS for a client who will be copying and pasting content into the body of nodes. I want to remove certain markup from coming through (eg inline styles) but allow other markup (p and br tags).

With the html filter I can stop certain markup being displayed but its still there in the content when you edit the node. Is there a way of stopping some markup from coming through at all? Thanks

0

Have a look at Sanitizable and Paste Format (filter, clean-up pasted text). The first cleans up on save, the second actually at paste.

1

Try out the WYSIWYG Filter module. It allows to restrict all described things.

enter image description here

After installation you will be able to configure its settings in the "Input formats" section.

  • This looks like the standard html filter in that it filters the output only – Evanss Oct 4 '12 at 15:41
  • This worked for my use case. Although the undesired markup is still in the DB, it does not get rendered (which in my case, avoided having to cleanup all existing nodes) – yorch Jun 6 '16 at 3:39
0

CKeditor is very complete and you can setup more functions than wysiwyg.

You can even decide with tag you want when you press enter or shift+enter.

It's very complete, have a look at it.

  • Im already using this. I can see how to limit the outputed html only. – Evanss Oct 4 '12 at 15:41
  • It's like you need a Paste as plain text, let me do some research. – Tyler Durden Oct 4 '12 at 16:03
  • If you go on ckeditor configuration page, and under advanced you find "Force pasting as plain text" . For me this works. Try it. – Tyler Durden Oct 4 '12 at 16:13
  • I thought this would but its not working – Evanss Oct 5 '12 at 9:50
  • Hi jdln, I've just tried it and it works. I pasted text from word and from different website. It does what you want. You should check all the filters, the allowed html tag and the other configurations. – Tyler Durden Oct 8 '12 at 10:20
0

You also may want to look into BU editor. You can set up wyswyg buttons for the type of code to allow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.