Jump to content

Best way to clean up RTF input


tibberous

Recommended Posts

I am trying to strip the formatting out of a Rich Text Editor. The editor itself only has buttons for center, bold, italics, ordered and unordered lists - no font sizes or font faces or images or tables or anything weird. The problem is that a lot of our clients are pasting in text from Word and other websites, so they get all the formatting characters that those applications support.

 

Basically, what I need to do is...

 

Convert <(div|span|h*|p...) style='font-weight: (bold|>600|bolder|boldest)'> </div> to <b></b>

...

 

Wow - there's a lot that this needs to do. Any ideas how I can strip it down easy?

 

Is there a general javascript onchange'ish even these RTE's use, or at least an on paste event?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.