0

i want to use prettyprint on my webpage, but it doesnt work...

i have a html snippet, but the browser interprets it as real html code.

in the html head, i have implemented

    <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<link rel="stylesheet" href="${cs.qualify("/css/prettify.css")}" type="text/css" media="screen" />

and my html code I inserted into a pre tag like this

<pre class="prettyprint"><div id="test"><h2>Hello</h2></div></pre>

i have no idea, whats the problem...

can anybody help me please?!!

Thanks

1 Answers1

0

You need to make sure that the angle brackets are converted in to HTML character entities within your pre tag. For example:

// This is <div>
&lt;div&gt;

// This is </div>
&lt;/div&gt;
mikkelz
  • 562
  • 3
  • 12