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

Skip some code blocks #66

Closed peske closed 4 years ago

peske commented 5 years ago

Is your feature request related to a problem? Please describe. In some cases, I don't want all the code blocks on a page to be numbered. Although it is currently possible by using block-by-block initialization (hljs.lineNumbersBlock(block)), it would be great if somehow I can mark code blocks to be skipped even with hljs.initLineNumbersOnLoad() initialization.

Describe the solution you'd like A custom class that can be set to <code> element, marking it for skipping.

Describe alternatives you've considered N/A

Additional context N/A

peske commented 5 years ago

Actually, I've already implemented that in my fork, and I've created a PR here: https://github.com/wcoder/highlightjs-line-numbers.js/pull/65