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/templates/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
..
actions Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) 1 year ago
branch Rework markup link rendering (#26745) 1 year ago
cite Update JS and PY dependencies (#27501) 1 year ago
code Fix more "locale" usages (#27259) 1 year ago
diff Rework markup link rendering (#26745) 1 year ago
editor Revert "Fix EOL handling in web editor" (#28101) 1 year ago
find Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
graph Rework markup link rendering (#26745) 1 year ago
issue Rework markup link rendering (#26745) 1 year ago
migrate Fix duplicate ID when deleting repo (#28520) 1 year ago
projects Use full width for project boards (#28225) 1 year ago
pulls Add `Hide/Show all checks` button to commit status check (#26284) 1 year ago
release Add download attribute to release attachments (#28739) 1 year ago
settings Add branch protection setting for ignoring stale approvals (#28498) 1 year ago
tag Fix more "locale" usages (#27259) 1 year ago
wiki Fix more "locale" usages (#27259) 1 year ago
activity.tmpl Fix more "locale" usages (#27259) 1 year ago
blame.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
branch_dropdown.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
clone_buttons.tmpl Fix more "locale" usages (#27259) 1 year ago
clone_script.tmpl Rework button coloring, add focus and active colors (#24507) 2 years ago
commit_load_branches_and_tags.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
commit_page.tmpl Rework markup link rendering (#26745) 1 year ago
commit_status.tmpl Restore warning commit status (#27504) 1 year ago
commit_statuses.tmpl Add `Hide/Show all checks` button to commit status check (#26284) 1 year ago
commits.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
commits_list.tmpl Rework markup link rendering (#26745) 1 year ago
commits_list_small.tmpl Rework markup link rendering (#26745) 1 year ago
commits_table.tmpl Fix more "locale" usages (#27259) 1 year ago
create.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
create_helper.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
empty.tmpl Fix more "locale" usages (#27259) 1 year ago
file_info.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
forks.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
graph.tmpl Fix more "locale" usages (#27259) 1 year ago
header.tmpl Revamp repo header (#27760) 1 year ago
home.tmpl Add word-break to repo description in home page (#27924) 1 year ago
icon.tmpl cleanup repo details icons/labels (#27644) 1 year ago
packages.tmpl Fix inconsistent user profile layout across tabs (#25625) 2 years ago
release_tag_header.tmpl Improve RSS feed icons (#28368) 1 year ago
search.tmpl Fix 500 error of searching commits (#28576) 1 year ago
search_name.tmpl Clean template/helper.go (#23922) 2 years ago
shabox_badge.tmpl cleanup locale function usage (#27227) 1 year ago
sub_menu.tmpl Enable followCursor for language stats bar (#27713) 1 year ago
unicode_escape_prompt.tmpl cleanup locale function usage (#27227) 1 year ago
upload.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
user_cards.tmpl Always use `ctx.Locale.Tr` inside templates (#27231) 1 year ago
view_file.tmpl Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
view_list.tmpl Rework markup link rendering (#26745) 1 year ago
watchers.tmpl Fix user-cards format (#24428) 2 years ago