google code prettify will not show images
-
02-07-2021 - |
Question
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>
La 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:
<img src="http://cm.g.doubleclick.net/pixel?google_nid=tt&google_cm&avid=9000&tag=alaska&campaign_id=8002" />
edit — however, that tool doesn't appear to have an HTML module.
Autres conseils
escaping the "<" and ">" will make it work
<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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow