highlightjs-line-numbers.js icon indicating copy to clipboard operation
highlightjs-line-numbers.js copied to clipboard

How can I use it in Node.js

Open jasonxia23 opened this issue 7 years ago • 3 comments

jasonxia23 avatar Jan 18 '18 12:01 jasonxia23

Hi, thanks for the question!

Current implementation doesn't allow use that with Node.JS

wcoder avatar Jan 18 '18 12:01 wcoder

IMO, to support using in Node.js, lineNumbersBlock should be extracted, which may be a breaking change to your preexisting API.

jasonxia23 avatar Jan 24 '18 06:01 jasonxia23

I found the code already pulled out (and nicely in typescript) here in another comment by @pwnoy.

It looks like Highlightjs supports node out of the box along with plugins, https://highlightjs.readthedocs.io/en/latest/plugin-api.html. Could we reconfigure this package to be added via a highlightjs plugin for both node and the browser? Or would it be better to create a fork?

ahouck avatar Jun 02 '20 14:06 ahouck