Removing most inline styles and properties with PHP
- by bakkelun
This question is related to a similar case, namely http://stackoverflow.com/questions/2488950/removing-inline-styles-using-php
The solution there does not remove i.e: <font face="Tahoma" size="4">
But let's say I have a mixed bag of inline styles and properties, like this:
<ul style="padding: 5px; margin: 5px;">
<li style="padding: 2px;"><div style="border:2px solid green;">Some text</div></li>
<li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li>
<li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li>
</ul>
What regExp is needed to achieve this result?
<ul>
<li><div>Some text</div></li>
<li><font>Some text</font></li>
<li><font>Some text</font></li>
</ul>
Thanks for reading the question, any help is appreciated.