forgejo/services
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
agit
asymkey
attachment
auth [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
automerge
context
convert Fix convert.ToTeams on empty input (#28426) (#28767) 2024-01-16 14:39:23 +00:00
cron
externalaccount
feed
forgejo
forms
gitdiff
indexer
issue
lfs
mailer Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
markup
migrations Use known issue IID to generate new PR index number when migrating from GitLab (#28616) (#28618) 2024-01-16 14:11:02 +00:00
mirror
notify
org
packages Fix alpine package files are not rebuilt (#28638) (#28665) 2024-01-16 14:16:55 +00:00
pull Concatenate error in checkIfPRContentChanged (#28731) (#28737) 2024-01-16 14:39:23 +00:00
release
repository
secrets
task
uinotification
user Forbid removing the last admin user (#28337) (#28793) 2024-01-16 14:41:11 +00:00
webhook
wiki