You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
KN4CK3R 637451a45e
Rework markup link rendering (#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>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
..
actions Fix schedule tasks bugs (#28691) 1 year ago
activities Speed up loading the dashboard on mysql/mariadb (#28546) 1 year ago
admin Next round of `db.DefaultContext` refactor (#27089) 1 year ago
asymkey Move more functions to db.Find (#28419) 1 year ago
auth Move more functions to db.Find (#28419) 1 year ago
avatars Refactor some legacy code and remove unused code (#28622) 1 year ago
db Move more functions to db.Find (#28419) 1 year ago
dbfs make writing main test easier (#27270) 1 year ago
fixtures Fix comment permissions (#28213) 1 year ago
git Add branch protection setting for ignoring stale approvals (#28498) 1 year ago
issues Rework markup link rendering (#26745) 1 year ago
migrations Add branch protection setting for ignoring stale approvals (#28498) 1 year ago
organization Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
packages Revert "packages: Calculate package size quota using package creator ID instead of owner ID (#28007)" (#28049) 1 year ago
perm Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
project Fix comment permissions (#28213) 1 year ago
pull Add Index to pull_auto_merge.doer_id (#27811) 1 year ago
repo Rework markup link rendering (#26745) 1 year ago
secret Use db.Find instead of writing methods for every object (#28084) 1 year ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 2 years ago
system Refactor deletion (#28610) 1 year ago
unit Make actions default enabled for newly created repository if global configuraion enabled (#27482) 1 year ago
unittest Upgrade xorm (#27673) 1 year ago
user Forbid removing the last admin user (#28337) 1 year ago
webhook Refactor deletion (#28610) 1 year ago
error.go Forbid removing the last admin user (#28337) 1 year ago
fixture_generation.go Replace more db.DefaultContext (#27628) 1 year ago
fixture_test.go Replace more db.DefaultContext (#27628) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
org.go Refactor deletion (#28610) 1 year ago
org_team.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
org_team_test.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
org_test.go Replace more db.DefaultContext (#27628) 1 year ago
repo.go Refactor deletion (#28610) 1 year ago
repo_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo_transfer.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
repo_transfer_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago