Search code examples
javascripthtmlprettify

google code prettify will not show images


I followed the instructions fr google preffify and all I get is a box with nonthing in it on the page. WHere did I go wrong? I get 200 for the includes.

 <link href="static/js/google-code-prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="static/js/google-code-prettify/prettify.js"></script>


<body onload="prettyPrint()">


        <pre class="prettyprint"><code class="language-html">
            <img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" /> 
        </code></pre>

        <pre class=prettyprint>
            <img src='http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002' /> 
        </pre>


</body>

Solution

  • If you're expecting the <img> tags to be prettified, that's not going to work; the browser is going to interpret them.

    Try escaping the < etc:

    &lt;img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" /&gt;
    

    edit — however, that tool doesn't appear to have an HTML module.