I have the problem that Visual Studio (or Resharper) removes whitespace after the tag when I use the formatting shortcut ctrl + k + d.
Example – before using the formatting shortcut:
<p>Sample text <b><span class="sometext"></span></b> fooo</p>
Example – after using the formatting shortcut:
<p>Sample text <b><span class="sometext"></span></b>fooo</p>
Ctrl+K+D runs Visual Studio formatter. To use ReSharper one, use Ctrl+E+C. But please note, that in HTML it can only fix indents for you – other spaces or new lines would stay intact.
P.S. One more shortcut for reformatting is Ctrl+E+F. First time when you invoke it you select profile (choose Reformat only and turn on using this profile by default for silent cleanup). Next time when you press Ctrl+E+F it would just silently reformat you code, without dialog.