0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 17:44:41 +01:00
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>
2024-01-16 02:13:29 +00:00
..
assignees.go
assignees_test.go
comment.go Upgrade xorm to new version which supported update join for all supported databases (#28590) (#28668) 2023-12-31 13:57:36 +08:00
comment_code.go Rework markup link rendering (#26745) (#28803) 2024-01-16 02:13:29 +00:00
comment_list.go
comment_test.go More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
content_history.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
content_history_test.go Fix comment permissions (#28213) (#28216) 2023-11-25 23:43:23 +00:00
dependency.go
dependency_test.go
issue.go
issue_index.go
issue_label.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 2023-10-06 05:06:31 +08:00
issue_label_test.go Don't let API add 2 exclusive labels from same scope (#27433) (#27460) 2023-10-06 05:06:31 +08:00
issue_list.go
issue_list_test.go
issue_lock.go
issue_project.go
issue_search.go
issue_stats.go
issue_test.go More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
issue_update.go Don't use subselect in DeleteIssuesByRepoID (#27332) (#27408) 2023-10-03 17:59:45 +08:00
issue_user.go
issue_user_test.go
issue_watch.go
issue_watch_test.go
issue_xref.go More db.DefaultContext refactor (#27265) (#27347) 2023-09-29 13:35:01 +00:00
issue_xref_test.go
label.go
label_test.go
main_test.go
milestone.go
milestone_list.go
milestone_test.go
pull.go
pull_list.go
pull_test.go
reaction.go
reaction_test.go
review.go Fix inperformant query on retrifing review from database. (#28552) (#28562) 2023-12-20 16:55:08 +01:00
review_list.go
review_test.go Fix 500 when deleting a dismissed review (#27903) (#27910) 2023-11-05 13:59:11 +00:00
stopwatch.go
stopwatch_test.go
tracked_time.go
tracked_time_test.go