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
https://forums.phpfreaks.com/topic/113951-best-way-to-clean-up-rtf-input/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.