Add line numbers to preformatted text

Hi all,

Users will regularly show their code to try and get help debugging them. To help us with this, could we have line numbers that would show on the left hand side of preformatted text? It would make it easier to point out to users where any errors are, or where they should place code.

And would it be possible to have them unselectable, so that when you copy and paste code, you wouldn’t need to remove the line numbers?

I think this text rendering is powered by markdown, it does not support line numbers.

Quotes are your best option.

markdown reference

1 Like

The problem is not the markdown, the problem is the library used to highlight code. Discourse uses highlight.js which does not support line numbers (prism for example does)

So this is simply out of scope for now since it would require quite a lot of work to implement in a clean way.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.