Skip to content
Alex Gorbatchev edited this page Feb 20, 2016 · 5 revisions

This applies to all versions of SyntaxHighlighter

💰 💰 💰 Please click here to donate via PayPal and just like they say on TV – give generously! It motivates me to keep working on this (12 years now and counting).

Strange tags in the output?

Are you expecting

Map<String, String> v = new HashMap<String, String>();

but getting?

Map<string, string=""> v = new HashMap<string, string="">();
</string,></string,>

If the answer is yes, please don't file another html escape bug, read on.

If you are using <pre /> tags, unfortunately you have to replace all < characters with &lt;, otherwise browsers think you have unclosed HTML tags.

Your actual HTML code should be:

<pre class="brush: java">
Map&lt;String, String> v = new HashMap&lt;String, String>();
</pre>

or use the <script /> tag instead:

<script type="text/syntaxhighlighter" class="brush: java"><![CDATA[
Map<String, String> v = new HashMap<String, String>();
]]></script>

Please see Usage for more details on the subject.