Hi all,
I was wondering if there was any way of removing unwanted style attributes from objects (p, ul, li etc), as for some reason my client has decided to copy/paste information from word into a wysiwyg and doesn't bother removing the crap that comes along with it, I was wondering if jquery could do this?
Here's an example of the outputted code (which varies obviously depending on what they've copied/pasted from)
<ul style="list-style-type: disc;">
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Residential Class 1/ New Buildings</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Residential Class 1/ Best Renovation</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Resorts, including apartments and aged care</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Public or Commercial Buildings</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Interior Fitout – Residential</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Interior Fitout – Commercial</li>
<li style="margin: 0.0px 0.0px 0.0px 0.0px; line-height: 21.0px; font: 12.0px 'Lucida Grande';">Outdoor Timber – Stand alone structures</li>
</ul>
Thoughts?
I've tried using strip_tags in php (and allow for p tags) but it brings the styles along with it.. even if this is possible in php that would be good :)