Highlight.js: Not working with XML/HTML

Created on 9 Jun 2015  路  5Comments  路  Source: highlightjs/highlight.js

I tried to use this library, it worked perfectly fine with css, but its not working with xml,html code.

Tried using all methods, but it is showing output of html instead of showing html code.

Most helpful comment

Hi,

I know this is an old topic. So, correct me if I am wrong.

I can not do:

<pre><code class="hljs xml">
    <h1>test</h1>
</code></pre>

But must do

<pre><code class="hljs xml">
    &lt;h1&gt;test&lt;/h1&gt;
</code></pre>

All 5 comments

Can you please provide any reproducable example? It looks like you don't properly escape HTML.

Here is what I did, please provide a client side html sample in documentation, which we can refer.

http://plnkr.co/edit/ecdGcjqRF71E8mJO6HlK?p=preview

Hi,

I know this is an old topic. So, correct me if I am wrong.

I can not do:

<pre><code class="hljs xml">
    <h1>test</h1>
</code></pre>

But must do

<pre><code class="hljs xml">
    &lt;h1&gt;test&lt;/h1&gt;
</code></pre>

@be-codified yes, correct.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OrbintSoft picture OrbintSoft  路  8Comments

Suyash2810 picture Suyash2810  路  8Comments

Lestoroer picture Lestoroer  路  7Comments

ghost picture ghost  路  3Comments

starikovs picture starikovs  路  5Comments