forgejo/models
KN4CK3R 875b398e5e
Rework markup link rendering (#26745) (#28803)
Backport #26745
Fixes #26548

This PR refactors the rendering of markup links. The old code uses
`strings.Replace` to change some urls while the new code uses more
context to decide which link should be generated.

The added tests should ensure the same output for the old and new
behaviour (besides the bug).

We may need to refactor the rendering a bit more to make it clear how
the different helper methods render the input string. There are lots of
options (resolve links / images / mentions / git hashes / emojis / ...)
but you don't really know what helper uses which options. For example,
we currently support images in the user description which should not be
allowed I think:

<details>
  <summary>Profile</summary>

https://try.gitea.io/KN4CK3R

![grafik](https://github.com/go-gitea/gitea/assets/1666336/109ae422-496d-4200-b52e-b3a528f553e5)

</details>

(cherry picked from commit 022552d5b6)
2024-01-16 14:41:11 +00:00
..
actions Only check online runner when detecting matching runners in workflows (#28286) (#28512) 2023-12-22 12:10:03 +01:00
activities Speed up loading the dashboard on mysql/mariadb (#28546) (#28784) 2024-01-16 14:40:56 +00:00
admin Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
asymkey Retry SSH key verification with additional CRLF if it failed (#28392) (#28464) 2023-12-22 12:05:11 +01:00
auth [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
avatars Refactor system setting (#27000) (#27452) 2023-10-05 10:37:59 +00:00
db Avoid cycle-redirecting user/login page (#28636) (#28658) 2024-01-16 14:11:44 +00:00
dbfs
fixtures Fix comment permissions (#28213) (#28216) 2023-11-26 13:56:50 +01:00
forgejo/semver [UPGRADE] add sanity checks for [storage*] 2023-11-13 12:33:49 +01:00
forgejo_migrations [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
git Fix GetCommitStatuses (#28787) (#28804) 2024-01-16 14:40:56 +00:00
issues Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
migrations handle repository.size column being NULL in migration v263 (#28336) (#28363) 2023-12-08 13:41:16 +01:00
organization Another round of db.DefaultContext refactor (#27103) (#27262) 2023-09-25 19:24:35 +02:00
packages
perm
project Fix comment permissions (#28213) (#28216) 2023-11-26 13:56:50 +01:00
pull [GITEA] GetScheduledMergeByPullID may involve a system user 2023-12-11 18:43:03 +01:00
repo Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
secret
shared/types
system Increase "version" when update the setting value to a same value as before (#28243) (#28244) 2023-12-08 13:40:59 +01:00
unit
unittest [GITEA] Introduce HTTP mocking utility for unit tests (#1858) 2023-12-01 19:17:46 +00:00
user Forbid removing the last admin user (#28337) (#28793) 2024-01-16 14:41:11 +00:00
webhook Fix comment permissions (#28213) (#28216) 2023-11-26 13:56:50 +01:00
error.go Forbid removing the last admin user (#28337) (#28793) 2024-01-16 14:41:11 +00:00
fixture_generation.go Fix yaml test (#27297) (#27303) 2023-09-27 15:05:35 +08:00
fixture_test.go Fix yaml test (#27297) (#27303) 2023-09-27 15:05:35 +08:00
main_test.go
org.go
org_team.go Use db.WithTx for AddTeamMember to avoid ctx abuse (#27095) 2023-09-16 12:54:23 +00:00
org_team_test.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
org_test.go
repo.go Refactor system setting (#27000) (#27452) 2023-10-05 10:37:59 +00:00
repo_test.go
repo_transfer.go [MODERATION] User blocking 2023-11-13 13:58:02 +01:00
repo_transfer_test.go [MODERATION] User blocking 2023-11-13 13:58:02 +01:00