-
As stated in the title, is there a way, or extension/plugin, to do so? An example from Quarto, which renders webpage from markdown files, too: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We're using highlight.js whose author is quite allergic to line numbers. There is a line number plugin but plumbing it (or something equivalent) into the call to hljs is not immediate (it happens in html.ts). Looking at how to use CSS counters to make this work, it appears that the only requirement is to wrap each line into its own DOM element (where currently we're just relying on line feeds). Then a bit of CSS would do the trick. Feel free to open a feature request (or better yet, a pull request if you manage to make it work!). |
Beta Was this translation helpful? Give feedback.
We're using highlight.js whose author is quite allergic to line numbers. There is a line number plugin but plumbing it (or something equivalent) into the call to hljs is not immediate (it happens in html.ts).
Looking at how to use CSS counters to make this work, it appears that the only requirement is to wrap each line into its own DOM element (where currently we're just relying on line feeds). Then a bit of CSS would do the trick.
Feel free to open a feature request (or better yet, a pull request if you manage to make it work!).