wcoder / highlightjs-line-numbers.js

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

feat: add function to process innerHTML instead and return value (#37) #55

Closed yaodingyd closed 5 years ago

yaodingyd commented 5 years ago

Add a new function lineNumbersValue to take in a string of html, usually it's the returned value of hljs.highlight(), and add line number to the markup.

Also change the function run synchronously compared to lineNumbersBlock because setTimeout makes it difficult to use the returned value.

wcoder commented 5 years ago

Thank you for help, I'll some refactor and merge to master asap.

yaodingyd commented 5 years ago

@wcoder Sweet! Thanks!