Highlight.js Line Numbers  Highlight.js Line Numbers

Highlight.js Line Numbers

This work is based off the original work located at: https://github.com/wcoder/highlightjs-line-numbers.js


  1. Adds:
    • links to line numbering
    • scroll to first linked line
    • selected lines highlight (by URI)
    • multiple of the former

It isn't likely to work well with multiple blocks of highlighted text on a single page. Feel free to submit a patch to help me out with this.

Wanted Features:

  • Link creation over a selection of lines.


This whilst being designed for integration with Fossil is with minor modificatins likely useable for the majority of people currently using the original work. The main thing you would need to change is the way it adds CSS.

To see it in action:

Note that the "&ln=" parameter can have the same sorts of line numbers/line number ranges as the hash parameter of the URI. This maintains backwards compatibility with the way Fossil does such.