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 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
..
archiver.go Move more functions to db.Find (#28419) 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 Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
collaboration.go Move more functions to db.Find (#28419) 1 year ago
collaboration_test.go Move more functions to db.Find (#28419) 1 year ago
fork.go Move more functions to db.Find (#28419) 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 Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
mirror.go More `db.DefaultContext` refactor (#27265) 1 year ago
pushmirror.go Refactor deletion (#28610) 1 year ago
pushmirror_test.go Refactor deletion (#28610) 1 year ago
redirect.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
redirect_test.go Final round of `db.DefaultContext` refactor (#27587) 1 year ago
release.go Move more functions to db.Find (#28419) 1 year ago
release_test.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
repo.go Rework markup link rendering (#26745) 1 year ago
repo_indexer.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
repo_list.go Restricted users only see repos in orgs which their team was assigned to (#28025) 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) 1 year ago
repo_unit.go Fix schedule tasks bugs (#28691) 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 Add orphaned topic consistency check (#28507) 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 Refactor deletion (#28610) 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 Refactor deletion (#28610) 1 year ago
watch_test.go Replace more db.DefaultContext (#27628) 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