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/issues
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
..
assignees.go Make more functions use ctx instead of db.DefaultContext (#24068) 2 years ago
assignees_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 1 year ago
comment.go Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668) 1 year ago
comment_code.go Rework markup link rendering (#26745) (#28803) 1 year ago
comment_list.go Add logs for data broken of comment review (#27326) (#27345) 1 year ago
comment_test.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
content_history.go Fix comment permissions (#28213) (#28216) 1 year ago
content_history_test.go Fix comment permissions (#28213) (#28216) 1 year ago
dependency.go Add API to manage issue dependencies (#17935) 2 years ago
dependency_test.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
issue.go Move some functions to service layer (#26969) 1 year ago
issue_index.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
issue_label.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 1 year ago
issue_label_test.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 1 year ago
issue_list.go Add context parameter to some database functions (#26055) 2 years ago
issue_list_test.go Add context parameter to some database functions (#26055) 2 years ago
issue_lock.go Rename almost all Ctx functions (#22071) 2 years ago
issue_project.go Use more `IssueList` instead of `[]*Issue` (#26369) 2 years ago
issue_search.go Fix review request number and add more tests (#27104) (#27168) 1 year ago
issue_stats.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
issue_test.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
issue_update.go Don't use subselect in `DeleteIssuesByRepoID` (#27332) (#27408) 1 year ago
issue_user.go Add index to `issue_user.issue_id` (#27154) (#27158) 1 year ago
issue_user_test.go Fix bug with sqlite load read (#26305) 2 years ago
issue_watch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_watch_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_xref.go More `db.DefaultContext` refactor (#27265) (#27347) 1 year ago
issue_xref_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 1 year ago
label.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
label_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
main_test.go move repository deletion to service layer (#26948) 1 year ago
milestone.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
milestone_list.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
milestone_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
pull.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
pull_list.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
pull_test.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
reaction.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
reaction_test.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
review.go Fix inperformant query on retrifing review from database. (#28552) (#28562) 1 year ago
review_list.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
review_test.go Fix 500 when deleting a dismissed review (#27903) (#27910) 1 year ago
stopwatch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
stopwatch_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
tracked_time.go Add context parameter to some database functions (#26055) 2 years ago
tracked_time_test.go Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052) 1 year ago