tibberous Posted July 9, 2008 Share Posted July 9, 2008 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? Quote Link to comment Share on other sites More sharing options...
discomatt Posted July 9, 2008 Share Posted July 9, 2008 Are you asking about javascript solutions, or php solutions? Quote Link to comment Share on other sites More sharing options...
tibberous Posted July 10, 2008 Author Share Posted July 10, 2008 PHP. I think I am just going to use ajax to clean up pasted code, that way I don't have to deal with two parsers, syncing them, or (as much) javascript. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.