- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.2k
Improve and fix markup code preview rendering #35777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Regarding line numbers, maybe there is some bug. I see this in the template but they don't render: <td class="lines-num"><span data-line-number="{{$line.Num}}"></span></td> | 
| Line numbers are fixed as well, the markup sanitizer was stripping the    Also as per screenshots in #30234, line numbers were intially working, so this must have regressed at some point. | 
| I think no need to backport to 1.24 since 1.25 has released. | 
1. Add the color on the link to the referenced file, which is the more likely thing the user wants to click 2. Use monospace font on the SHA 3. Tweak text colors 4. Change SHA link to go to the commit instead of the repo root with commit filter set 5. Added the repo name to the file link text 6. Fix broken line numbering rendering
Backport #35777 by @silverwind 1. Add the color on the link to the referenced file, which is the more likely thing the user wants to click 2. Use monospace font on the SHA 3. Tweak text colors 4. Change SHA link to go to the commit instead of the repo root with commit filter set 5. Added the repo name to the file link text 6. Fix broken line numbering rendering The only major difference to GitHub is now the missing line numbers. Before: <img width="286" height="162" alt="Screenshot 2025-10-29 at 19 09 59" src="https://github.com/user-attachments/assets/f16b4eec-caf2-4c31-a2b5-ae5f41747d4b" /> After: <img width="378" height="157" alt="image" src="https://github.com/user-attachments/assets/0c91dfd3-0910-4b2d-a43b-8c87cfbb933e" /> For comparison, GitHub rendering: <img width="286" height="177" alt="image" src="https://github.com/user-attachments/assets/8a9a07b7-9153-4415-9d7a-5685853e472a" /> Co-authored-by: silverwind <me@silverwind.io>
The only major difference to GitHub is now the missing line numbers.
Before:
After:
For comparison, GitHub rendering: