like this:
<p style="font-size: 12pt;">
Hello world
<span style="font-weight: bold;">just do it</span>
</p>
I want to remove every element's "style" attribute. I want the result like this:
<p>Hello world <span>just do it</span></p>
how to do this using hpricot?
thanks.
ok I have solved this like below:
doc = Hpricot("<p style='xxx'>are you ok?</p>")
doc.search("[@style]").each do |e|
e.remove_attribute("style")
end