title: ASP.NET MVC "Tidy" Html on the fly
body: <p>I'm wondering if there's any kind of tool out there to <a href="http://www.w3.org/People/Raggett/tidy/" rel="nofollow noreferrer">Tidy</a> Html on the fly.</p>
  
  <p>Currently in my app, I use a MasterPage and then my Views are loaded into the Masterpage.  The problem is that the <code>&lt;asp:content runat="server" ... /&gt;</code> always adds additional whitespace/linebreaks in the output HTML.</p>
  
  <p>What I'd really like to do is clean it up so that</p>
  
  <pre><code>&lt;title&gt;
      This is my title
  
  &lt;/title&gt;
  </code></pre>
  
  <p>will look like</p>
  
  <pre><code>&lt;title&gt;This is my title&lt;/title&gt;
  </code></pre>
  
  <p>Now I realize that I can go through and set</p>
  
  <pre><code>&lt;asp:content ID="Content1" runat="server" ContentPlaceHolderID="TitleContent"&gt;This is my title&lt;/asp:content&gt;
  </code></pre>
  
  <p>But that becomes a pain because I often use <kbd>Ctrl</kbd> + <kbd>k</kbd> + <kbd>d</kbd> which results in the reformatting that is undesirable.</p>
  
  <p>Moreover, when I use inline code like</p>
  
  <pre><code> &lt;asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"&gt;User &lt;%: Model.UserName%&gt; - Urban Now&lt;/asp:Content&gt;
  </code></pre>
  
  <p>and use the "reformatting" key strokes, then there are also line breaks before and after the <code>&lt;%: Model.UserName%&gt;</code> and there is no way to set that formatting in the "Tools/Options/Formatting --> Tag Specific Options" (at least not that I can find).</p>