wcoder / highlightjs-line-numbers.js

Line numbering plugin for Highlight.js
https://wcoder.github.io/highlightjs-line-numbers.js/
MIT License
541 stars 125 forks source link

Option to use in nodejs environment (without window) #96

Open maor-benami opened 1 year ago

maor-benami commented 1 year ago

highlight.js can be used on server side to change code tags

line-numbers plugin depends on window

https://stackoverflow.com/questions/48843806/how-to-use-npm-marked-with-highlightjs

skoropadas commented 1 year ago

For those who are looking for the functionality of adding lines on the Node.js side can look at the plugin for rehype in my repository, it splits into lines and wraps the content created by rehype-highlight in span.line which in the future you can use to create numbered lines.