This is already implemented in Microsoft Sharepoint Designer and Microsoft Expression Web for many years.
You can test this feature here for free (only via Internet Explorer).
I created animated GIF to show how it works:

Moderator: TopStyle Support
Code: Select all
<p class="one"><span>test</span></p>
<p class="two"><em>test</em><p>
<div class="three">test</div>