-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
When using php as language and an html element contains a class attribute the result contains an extra line containing only: {1}
To Reproduce
Minimal bug example:
<head>
<!-- HighlightJs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<!-- HighlightJs with line numbering include *after* HighlighJs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.3.0/highlightjs-line-numbers.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
</script>
</head>
<body>
<pre><code class="php language-php"><div class="arbitrary">
</div>
</code></pre>
</body>
Result
1 | <div class="arbitrary">
2 | </div>
3 | {1}
Expected behavior
1 | <div class="arbitrary">
2 | </div>
Additional context
I've boiled it done to the class="arbitrary"
attribute. If you omit it everything is fine. You'll find the minimal example at JSFiddle as well.