1
1
mirror of https://github.com/go-gitea/gitea.git synced 2026-03-17 11:35:22 +01:00
gitea/services/markup
Giteabot e194d89c74
Improve and fix markup code preview rendering (#35777) (#35787)
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>
2025-10-30 09:06:44 +00:00
..
main_test.go Add sub issue list support (#32940) 2024-12-24 01:54:19 +00:00
renderhelper_codepreview_test.go Improve and fix markup code preview rendering (#35777) (#35787) 2025-10-30 09:06:44 +00:00
renderhelper_codepreview.go Improve and fix markup code preview rendering (#35777) (#35787) 2025-10-30 09:06:44 +00:00
renderhelper_issueicontitle_test.go Add sub issue list support (#32940) 2024-12-24 01:54:19 +00:00
renderhelper_issueicontitle.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
renderhelper_mention_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
renderhelper.go Fix context usage (#33554) 2025-02-11 16:46:03 +08:00