I'm redesigning a web site that has a bunch of tags in the content pasted in from Word. I would like to get rid of every instance of a font tag.
I would also like to get rid of all the inline style usually put in with
<span style="font-family:Verdana, etc.;">...</span>
I want to keep all the a, em, br, strong tags, so I don't want to strip all tags just the ones that effect the stylings of the content.
This content is all in a MySQL database and a MySQL solution is preferred over a PHP solution, but I will take either at this point.
Maybe it's not the best solution to the problem but here is what I'm doing. I tried some different scripts to get the info from the database, clean it up and post it back with PHP, but nothing really worked that well. Everything I used messed up the data, more than it helped. GIGO.
I decided on using javascript (jQuery) to take all the attributes out of <font> tags and clear the style attribute of all <span> and <p> tags. Everything looks fine after doing this. All future content will be right going into the system, but all the old content has the ugly code still in the database, which is cleaned up enough to display right on the client side.