Search code examples
htmlprettify

does prettify not work with html?


I am trying to use prettify like this:

<code class="prettyprint lang-html">
    <link rel="stylesheet" href="themes/myPlug/styles.css?v=1.0">
    <script src="js/myPlug.js"></script>
</code>

But no text is output on my page, do I have to manually convert every bracket, ie.

< to &lt;

and

> to &gt;

in order to use prettify with HTML code?


Solution

  • Yes you need to convert < to &lt; and > to &gt; manually. Also to note that prettify works with HTML but for the brackets you have to change them manually.