-
-
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>
* giteaofficial/main: Add cache to container build (go-gitea#35697) Revert gomail to v0.7.0 to fix sending mail failed (go-gitea#35816) Fix circular spin animation direction (go-gitea#35785) Fix clone mixed bug (go-gitea#35810) [skip ci] Updated translations via Crowdin Remove unnecessary function parameter (go-gitea#35765) Fix cli "Before" handling (go-gitea#35797) Add test for ExtendCommentTreePathLength migration and fix bugs (go-gitea#35791) Fix file extension on gogs.png (go-gitea#35793) Improve and fix markup code preview rendering (go-gitea#35777)
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [go-gitea/gitea](https://github.com/go-gitea/gitea) | patch | `1.25.0` -> `1.25.1` | --- ### Release Notes <details> <summary>go-gitea/gitea (go-gitea/gitea)</summary> ### [`v1.25.1`](https://github.com/go-gitea/gitea/releases/tag/v1.25.1) [Compare Source](go-gitea/gitea@v1.25.0...v1.25.1) - BUGFIXES - Make ACME email optional ([#​35849](go-gitea/gitea#35849)) [#​35857](go-gitea/gitea#35857) - Add a doctor command to fix inconsistent run status ([#​35840](go-gitea/gitea#35840)) ([#​35845](go-gitea/gitea#35845)) - Remove wrong code ([#​35846](go-gitea/gitea#35846)) - Fix viewed files number is not right if not all files loaded ([#​35821](go-gitea/gitea#35821)) ([#​35844](go-gitea/gitea#35844)) - Fix incorrect pull request counter ([#​35819](go-gitea/gitea#35819)) ([#​35841](go-gitea/gitea#35841)) - Upgrade go mail to 0.7.2 and fix the bug ([#​35833](go-gitea/gitea#35833)) ([#​35837](go-gitea/gitea#35837)) - Revert gomail to v0.7.0 to fix sending mail failed ([#​35816](go-gitea/gitea#35816)) ([#​35824](go-gitea/gitea#35824)) - Fix clone mixed bug ([#​35810](go-gitea/gitea#35810)) ([#​35822](go-gitea/gitea#35822)) - Fix cli "Before" handling ([#​35797](go-gitea/gitea#35797)) ([#​35808](go-gitea/gitea#35808)) - Improve and fix markup code preview rendering ([#​35777](go-gitea/gitea#35777)) ([#​35787](go-gitea/gitea#35787)) - Fix actions rerun bug ([#​35783](go-gitea/gitea#35783)) ([#​35784](go-gitea/gitea#35784)) - Fix actions schedule update issue ([#​35767](go-gitea/gitea#35767)) ([#​35774](go-gitea/gitea#35774)) - Fix circular spin animation direction ([#​35785](go-gitea/gitea#35785)) ([#​35823](go-gitea/gitea#35823)) - Fix file extension on gogs.png ([#​35793](go-gitea/gitea#35793)) ([#​35799](go-gitea/gitea#35799)) - Add pnpm to Snapcraft ([#​35778](go-gitea/gitea#35778)) Instances on **[Gitea Cloud](https://cloud.gitea.com)** will be automatically upgraded to this version during the specified maintenance window. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xOC4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsia2luZC9kZXBlbmRlbmN5Il19--> Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/981 Reviewed-by: Markus Pesch <volker.raschek@noreply.gitea.com> Co-authored-by: Renovate Bot <renovate-bot@gitea.com> Co-committed-by: Renovate Bot <renovate-bot@gitea.com>

The only major difference to GitHub is now the missing line numbers.
Before:
After:
For comparison, GitHub rendering: