Reputation:
This is probably fairly straightforward but I can't find a solution anywhere. When using:
http://www.steamdev.com/snippet/
$("pre.htmlCode").snippet("html",{style:"greenlcd"});
<pre class="htmlCode" style="float:left;">
<h1>Snippet style selector</h1>
<div class="instructions">
<p>Choose your style below.</p>
<p>Preview your style here.</p>
</div>
<!-- 39 styles to choose from! -->
</pre>
This seems to work, except the tags are being processed like this:
How do I prevent this from happening? I hope this is clear enough!
Upvotes: 1
Views: 60
Reputation: 46816
In your <pre>
, you need to escape the HTML.
<pre class="htmlCode" style="float:left;">
<h1>Snippet style selector</h1>
<div class="instructions">
<p>Choose your style below.</p>
<p>Preview your style here.</p>
</div>
<!-- 39 styles to choose from! -->
</pre>
Or in case of XHTML, use <[CDATA[ ... ]]>
Upvotes: 0