forgejo/routers/web
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
..
admin Forbid removing the last admin user (#28337) (#28793) 2024-01-16 14:41:11 +00:00
auth [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
devtest Make "cancel" buttons have proper type in modal forms (#25618) 2023-07-03 14:04:50 +08:00
events Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
explore Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
feed Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
healthcheck [BRANDING] cosmetic s/Gitea/Forgejo/ in logs, messages, etc. 2023-11-13 13:58:17 +01:00
misc Refactor CORS handler (#28587) (#28611) 2024-01-16 14:08:38 +00:00
org Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
repo Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
shared Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
user Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
base.go Fix panic in storageHandler (#27446) (#27479) 2023-10-06 16:51:26 +02:00
githttp.go Refactor CORS handler (#28587) (#28611) 2024-01-16 14:08:38 +00:00
goget.go Support SSH for go get (#24664) 2023-05-12 09:44:37 +00:00
home.go [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
metrics.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nodeinfo.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
swagger_json.go Start using template context function (#26254) 2023-08-08 01:22:47 +00:00
web.go [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
webfinger.go Add a link to OpenID Issuer URL in WebFinger response (#26000) 2023-07-20 16:02:45 +08:00