I don't browse the forums as much as I used to so I haven't made any attempts to modify the code
. If you kindly ask lexios he may give you his instructions for enabling syntax highlighting and line numbering with GreaseMonkey.
If anyone decides to edit code.js as it is then I'll share an important observation. When designing the pastebin
I noticed a challenge with line numbering.
In HTML there are three ways to display line numbers: ordered lists, a table with two columns or the CSS text-before property.
Ordered lists break copy and pasting, select the middle two lines from the following list in your browser:[*:3i4ny9pf]line 1[*:3i4ny9pf]line 2[*:3i4ny9pf]line 3[*:3i4ny9pf]line 4Paste it into Notepad or any text editor, you will see something like:
# line 2
# line 3
pastebin.com and other similar sites have this flaw.
The table trick does not break copying but you sacrifice text wrapping since every line has to be the same vertical height for the numbers on the left column to match the line of code on the right. This is the option I chose, but in some cases it results in ugly horizontal scrolling.
CSS has a text-before property which could work but is not supported by IE8 and below. 40-50% of users on my sites are still using a version of IE which is too significant to ignore.