-
-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Description
This issue is the behavior of lib/highlight.js
.
In case of wrap: false
:
If hljs: true
, an HTML class name hljs
appears in the output.
If hljs: false
, no HTML class name appears in the output.
It is a lack of consistency.
I think an HTML class name highlight
should appear as well as when wrap: true
.
And also, the output for hljs: false
lacks a PRE element and a CODE element.
That is, no HTML element appears around the output.
It is a lack of consistency, too.
Expected behavior
The output of util.highlight('alert("foobar")', {wrap: false})
is:
<pre><code class="highlight">alert("foobar")</code></pre>
Actual behavior
alert("foobar")
How to reproduce?
$ node
> const util = require('.')
undefined
> util.highlight('alert("foobar")', {wrap: false})
'alert("foobar")'
> util.highlight('alert("foobar")', {wrap: false, hljs: true})
'<pre><code class="hljs undefined">alert("foobar")</code></pre>'
>
Environment & Settings
$ node -v
v8.16.2
$ npm -v
6.4.1
$ git log --oneline --decorate -1
b292332 (HEAD -> master, upstream/master, origin/master, origin/HEAD) Merge pull request #109 from curbengh/toc
Metadata
Metadata
Assignees
Labels
No labels