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/repo
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>
1 year ago
..
archiver.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
attachment.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
attachment_test.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
avatar.go Add context cache as a request level cache (#22294) 2 years ago
collaboration.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
collaboration_test.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
fork.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
fork_test.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
git.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
issue.go Rename almost all Ctx functions (#22071) 2 years ago
language_stats.go Round language stats percentage using largest remainder (#22026) 2 years ago
main_test.go move repository deletion to service layer (#26948) 1 year ago
mirror.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
pushmirror.go Add `RemoteAddress` to mirrors (#26952) 1 year ago
pushmirror_test.go Replace `interface{}` with `any` (#25686) 2 years ago
redirect.go Implement FSFE REUSE for golang files (#21840) 2 years ago
redirect_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
release.go Fix comment permissions (#28213) (#28216) 1 year ago
release_test.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
repo.go Rework markup link rendering (#26745) (#28803) 1 year ago
repo_indexer.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_list.go Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051) 1 year ago
repo_list_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 1 year ago
repo_test.go Refactor SSH clone URL generation code (#28421) (#28480) 1 year ago
repo_unit.go Fix schedule tasks bugs (#28691) (#28780) 1 year ago
repo_unit_test.go add disable workflow feature (#26413) 2 years ago
search.go Split "modules/context.go" to separate files (#24569) 2 years ago
star.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
star_test.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
topic.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
topic_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
update.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
upload.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
user_repo.go Refactor authors dropdown (send get request from frontend to avoid long wait time) (#23890) 2 years ago
user_repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
watch.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
watch_test.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
wiki.go Implement FSFE REUSE for golang files (#21840) 2 years ago
wiki_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago