wcoder/highlightjs-line-numbers.js

How can I use it in Node.js

jasonxia23 opened this issue · 3 comments

How can I use it in Node.js

Hi, thanks for the question!

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

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

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?