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 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
..
assignees.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
assignees_test.go Remove deadcode under models/issues (#28536) 1 year ago
comment.go Move more functions to db.Find (#28419) 1 year ago
comment_code.go Rework markup link rendering (#26745) 1 year ago
comment_list.go Add logs for data broken of comment review (#27326) 1 year ago
comment_test.go More `db.DefaultContext` refactor (#27265) 1 year ago
content_history.go Fix comment permissions (#28213) 1 year ago
content_history_test.go Fix comment permissions (#28213) 1 year ago
dependency.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
dependency_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue.go Remove deadcode under models/issues (#28536) 1 year ago
issue_index.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
issue_label.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue_label_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 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 Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
issue_project.go Clean some functions about project issue (#27705) 1 year ago
issue_search.go Remove deadcode under models/issues (#28536) 1 year ago
issue_stats.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
issue_test.go Refactor deletion (#28610) 1 year ago
issue_update.go Don't use subselect in `DeleteIssuesByRepoID` (#27332) 1 year ago
issue_user.go Add combined index for issue_user.uid and issue_id (#28080) 1 year ago
issue_user_test.go Fix bug with sqlite load read (#26305) 2 years ago
issue_watch.go Even more `db.DefaultContext` refactor (#27352) 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) 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 Refactor deletion (#28610) 1 year ago
label_test.go Remove deadcode under models/issues (#28536) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
milestone.go Refactor timeutil package (#28623) 1 year ago
milestone_list.go Remove deadcode under models/issues (#28536) 1 year ago
milestone_test.go Remove deadcode under models/issues (#28536) 1 year ago
pull.go Add branch protection setting for ignoring stale approvals (#28498) 1 year ago
pull_list.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
pull_test.go Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
reaction.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
reaction_test.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
review.go Refactor some legacy code and remove unused code (#28622) 1 year ago
review_list.go Another round of `db.DefaultContext` refactor (#27103) 1 year ago
review_test.go Fix 500 when deleting a dismissed review (#27903) 1 year ago
stopwatch.go Remove deadcode under models/issues (#28536) 1 year ago
stopwatch_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
tracked_time.go Move more functions to db.Find (#28419) 1 year ago
tracked_time_test.go Show total TrackedTime on issue/pull/milestone lists (#26672) 1 year ago