title: What is the correct razor syntax for nested and mixed code blocks?
body: <p>I have razor syntax that's nested and mixed in with html and javascript.</p>
  
  <p>It runs fine except when I do a auto code format, the <code>}</code> keeps getting push out of place.</p>
  
  <pre><code>@section js{
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
  
              @if (ViewBag.Searched &amp;&amp; ViewBag.Found)
              {
                  @:$('#found').show(); $('#permit-info').show();
  
                  @if (ViewBag.PendingRequest)
                  {
                      @:$('#request-info').hide(); $('#report-info').show();
                  }
                  else
                  {
                      @:$('#request-info').show(); $('#report-info').hide();
                  }
              }
              else
              {
                  @if (ViewBag.Searched)
                  {
                      @:$('#not-found').show();
                              } // &lt;----- PROBLEM. this } doesn't stay at the right place.
              }
          });
      &lt;/script&gt;
  }
  </code></pre>