Describe the issue
When applying highlight.js to the following code block,
<pre><code class="html"><script>foo();</script></code></pre>
I am expecting <script>foo();</script>, but it prints <script></script> without foo(); inside. I understand if the javascript cannot be highlighted since the language is set as html. However, the disappearance of the contents does not look good.
Which language seems to have the issue?
html
Are you using highlight or highlightAuto?
I used initHighlightingOnLoad.
...
Sample Code to Reproduce
Here is jsfiddle: https://jsfiddle.net/6ey310qL/1/
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.js"></script>
</head>
<body>
<pre><code class="html"><script>foo();</script></code></pre>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
I changed:
https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.jsExpected behavior
<script>foo();</script>
is printed in the code block.
Additional context
Is this a bug? or a feature?
Looks like a bug to me. I'll need to dig in deeper.
v10.0.1 just released includes this fix.
@yyyc514 Thank you very much for fixing this so quickly!