Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with XML/HTML #866

Closed
dlinx opened this issue Jun 9, 2015 · 5 comments
Closed

Not working with XML/HTML #866

dlinx opened this issue Jun 9, 2015 · 5 comments

Comments

@dlinx
Copy link

dlinx commented Jun 9, 2015

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.

@Sannis
Copy link
Collaborator

Sannis commented Jun 9, 2015

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

@Sannis Sannis closed this as completed Jun 9, 2015
@dlinx
Copy link
Author

dlinx commented Jun 10, 2015

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

@Sannis
Copy link
Collaborator

Sannis commented Jun 10, 2015

Yes, you should escape HTML within <pre><code> block.

Few references:
http://stackoverflow.com/questions/42182/how-to-escape-and-inside-pre-tags
http://www.w3schools.com/HTML/html_entities.asp

@ZigaVukcevicDev
Copy link

ZigaVukcevicDev commented Feb 26, 2017

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>

@isagalaev
Copy link
Member

@be-codified yes, correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants