Greasy Fork is available in English.

讨论 » Greasy Fork 反馈

Line numbers above 9999 don't fit.

§
发表于:2023-11-26
编辑于:2023-11-26

There is seems to be a browser limitation for <ol> lists, where only last 4 digits are fit in the available width. So, if script has more than 9999 lines, it starts showing incorrect line numbers.

A quick CSS-only solution for modern browsers:

ol
{
  --offset: 3.5ch;
  padding-inline-start:var(--offset);
}
ol:has(li:nth-child(10)){--offset:4.5ch}
ol:has(li:nth-child(100)){--offset:5.5ch}
ol:has(li:nth-child(1000)){--offset:6.5ch}
ol:has(li:nth-child(10000)){--offset:7.5ch}
ol:has(li:nth-child(100000)){--offset:8.5ch}
ol:has(li:nth-child(1000000)){--offset:9.5ch}
ol:has(li:nth-child(10000000)){--offset:10.5ch}
ol:has(li:nth-child(100000000)){--offset:11.5ch}
ol:has(li:nth-child(1000000000)){--offset:12.5ch}
ol:has(li:nth-child(10000000000)){--offset:13.5ch}
ol:has(li:nth-child(100000000000)){--offset:14.5ch}
ol:has(li:nth-child(1000000000000)){--offset:15.5ch}

§
发表于:2023-11-28
编辑于:2023-11-28

Yes. The code viewer in GreasyFork is quite simple and basic.

You might consider using this to view code in GreasyFork. (just viewing, not editing)

https://greasyfork.org/en/scripts/472051

§
发表于:2024-08-10

You might consider using this to view code in GreasyFork. (just viewing, not editing)

It actually works about 5 times faster for larger scripts (10k+ lines) Thanks!

发表回复

登录以发表回复。