Show line numbers in code blocks

Can you please display line numbers in code blocks?
Using line numbers, I can refer code and add notes to it.

thank you!

Could be a specific case of a more general styling system.

That way line numbering could be also used for other types of Rem (if the user wants), for example.

Intermediate workaround to just display line numbers with Custom CSS:

.codeLine {
  counter-increment: codeLineNumber;
}
.codeLine:before {
  content: counters(codeLineNumber, '.') " ";
}

These can’t be referenced individually though and they are not shown when editing (and on hover).

1 Like