in reply to Converting span tags.
I think you could use HTML::TreeBuilder to build a tree of the HTML. Then scan your tree converting spans with specific attributes to b,i, and u tags as needed. Then flatten the tree back into HTML.