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? Link to comment https://forums.phpfreaks.com/topic/113951-best-way-to-clean-up-rtf-input/ 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? Link to comment https://forums.phpfreaks.com/topic/113951-best-way-to-clean-up-rtf-input/#findComment-585691 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. Link to comment https://forums.phpfreaks.com/topic/113951-best-way-to-clean-up-rtf-input/#findComment-586304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.