forgejo/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>
2024-01-15 08:49:24 +00:00
..
assignees.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
assignees_test.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
comment.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
comment_code.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
comment_list.go
comment_test.go
content_history.go Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
content_history_test.go Fix comment permissions (#28213) 2023-11-25 17:21:21 +00:00
dependency.go
dependency_test.go
issue.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
issue_index.go
issue_label.go
issue_label_test.go
issue_list.go
issue_list_test.go
issue_lock.go
issue_project.go
issue_search.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
issue_stats.go
issue_test.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
issue_update.go
issue_user.go Add combined index for issue_user.uid and issue_id (#28080) 2023-12-14 09:26:59 +00:00
issue_user_test.go
issue_watch.go
issue_watch_test.go
issue_xref.go
issue_xref_test.go
label.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
label_test.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
main_test.go
milestone.go Refactor timeutil package (#28623) 2023-12-28 10:09:57 +00:00
milestone_list.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
milestone_test.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
pull.go Add branch protection setting for ignoring stale approvals (#28498) 2024-01-15 07:20:01 +00:00
pull_list.go
pull_test.go
reaction.go
reaction_test.go
review.go Refactor some legacy code and remove unused code (#28622) 2023-12-28 09:38:59 +00:00
review_list.go
review_test.go
stopwatch.go Remove deadcode under models/issues (#28536) 2023-12-19 20:12:02 +01:00
stopwatch_test.go
tracked_time.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
tracked_time_test.go