Stripping <style> and <link> tags from value
<p>I am trying to clean up some HTML values that are imported from other sources, primarily email message bodies. Ideally, I would like to be able to strip <code>&lt;style&gt;</code> and <code>&lt;link&gt;</code> tags, but also apply their styles (assuming the link tag points to a style sheet) to the appropriate elements within the value.</p>

<p>I am currently trying to accomplish this via <a href="http://us2.php.net/manual/en/class.tidy.php" rel="nofollow">tidy</a>. If it comes down to it, I can strip out the tags without applying the styles.</p>
