forgejo/templates
KN4CK3R 022552d5b6
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>
2024-01-16 02:13:29 +00:00
..
admin Add word break to the repo list in admin settings page (#28034) (#28035) 2023-11-14 14:31:43 +08:00
api/packages/pypi Remove incorrect HTML self close tag (#23748) 2023-03-27 18:05:51 +02:00
base Avoid unnecessary 500 panic when a commit doesn't exist (#28719) (#28721) 2024-01-07 10:40:30 +00:00
code Fix 500 error of searching commits (#28576) (#28579) 2023-12-22 02:29:28 +00:00
custom Add footer extra links template (#9576) 2020-01-03 20:41:56 +02:00
devtest Improve dropdown button alignment and fix hover bug (#27632) (#27637) 2023-10-16 16:15:15 +08:00
explore Keep profile tab when clicking on Language (#28320) (#28331) 2023-12-03 14:54:53 +00:00
mail Update team invitation email link (#26550) 2023-08-31 16:26:13 +00:00
org Fix button size in "attached header right" (#28770) (#28774) 2024-01-12 15:04:19 +00:00
package switch destination directory for apt signing keys (#28639) (#28642) 2023-12-29 05:44:47 +00:00
projects Use full width for project boards (#28225) (#28245) 2023-11-27 18:20:53 +00:00
repo Rework markup link rendering (#26745) (#28803) 2024-01-16 02:13:29 +00:00
shared Fix wrong due date rendering in issue list page (#28588) (#28591) 2023-12-22 17:25:43 +00:00
status Clean up template locale usage (#27856) (#27857) 2023-10-31 17:35:55 +01:00
swagger Forbid removing the last admin user (#28337) (#28793) 2024-01-16 01:51:46 +00:00
user Rework markup link rendering (#26745) (#28803) 2024-01-16 02:13:29 +00:00
webhook Extract common code to new template (#26933) 2023-09-06 10:11:06 +00:00
home.tmpl Backport ctx locale refactoring manually (#27231) (#27259) (#27260) 2023-09-25 13:15:51 +00:00
install.tmpl Backport ctx locale refactoring manually (#27231) (#27259) (#27260) 2023-09-25 13:15:51 +00:00
post-install.tmpl Backport ctx locale refactoring manually (#27231) (#27259) (#27260) 2023-09-25 13:15:51 +00:00