I
I
Isaac Clark2015-11-07 16:48:45
JavaScript
Isaac Clark, 2015-11-07 16:48:45

Why isn't highlight.js working?

Hello, I installed highlight.js

<head>
    <link rel="stylesheet" href="styles/default.css" type="text/css">
    <script src="jQuey.js"></script>
    <script src="highlight.pack.js"></script>
</head>
<body>
<pre>
    <code class="lang-html html">
        <span>Hello World</span>

But for some reason the span tag is not highlighted, it is not even visible, only the text that is in it. That is, it was used as a tag. But isn't the trick of this library to escape tags and highlight them?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Kulyash, 2015-11-07
@rekzi

The library does not escape anything.
There are examples in the library's github repository. Modify them.

Y
Yaroslav Lyzlov, 2015-11-07
@dixoNich

<script>hljs.initHighlightingOnLoad();</script>
From an example. You don't see that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question