How to achieve (auto) code format selection of any html code via jQuery / C# ? (Any solution)
<p>Our application can share code. For example user is sharing the html code as follows</p>

<pre><code>&lt;div id="nav-vert-one"&gt;

&lt;ul&gt;
{{for GroupCollection}}
&lt;li&gt;
 &lt;a href="#" title="{{:Name}}" onclick="test()"&gt;      {{:Name}}&lt;/a&gt;
('{{:GroupId}}')"&gt;

&lt;/li&gt;
{{/for}}
&lt;/ul&gt;
</code></pre>

<p>which is not in a perfect format .... Now i need to achieve the (auto) code formatting ...</p>

<p>i.e. after auto code format click, it should look like </p>

<pre><code>&lt;div id="nav-vert-one"&gt;
    &lt;ul&gt;
        {{for GroupCollection}}
        &lt;li&gt;&lt;a href="#" title="{{:Name}}" onclick="test()"&gt; {{:Name}}&lt;/a&gt;
('{{:GroupId}}')"&gt;&lt;/li&gt;
        {{/for}}
    &lt;/ul&gt;
</code></pre>

<p>So, is there ready made plugin available or is there any way(s) to achieve it either via jQuery or C#?</p>
