0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-03-03 18:26:43 -05:00
forgejo/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>
2024-01-15 08:49:24 +00:00
..
actions
branch Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
cite
code
diff Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
editor
find
graph Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
issue Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
migrate
projects
pulls
release Add download attribute to release attachments (#28739) 2024-01-09 16:51:20 +08:00
settings Add branch protection setting for ignoring stale approvals (#28498) 2024-01-15 07:20:01 +00:00
tag
wiki
activity.tmpl
blame.tmpl
branch_dropdown.tmpl
clone_buttons.tmpl
clone_script.tmpl
commit_load_branches_and_tags.tmpl
commit_page.tmpl Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
commit_status.tmpl
commit_statuses.tmpl
commits.tmpl
commits_list.tmpl Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
commits_list_small.tmpl Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
commits_table.tmpl
create.tmpl
create_helper.tmpl
empty.tmpl
file_info.tmpl
forks.tmpl
graph.tmpl
header.tmpl Revamp repo header (#27760) 2024-01-12 03:44:06 +00:00
home.tmpl
icon.tmpl
packages.tmpl
release_tag_header.tmpl
search.tmpl Fix 500 error of searching commits (#28576) 2023-12-21 23:09:14 +00:00
search_name.tmpl
shabox_badge.tmpl
sub_menu.tmpl
unicode_escape_prompt.tmpl
upload.tmpl
user_cards.tmpl
view_file.tmpl
view_list.tmpl Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
watchers.tmpl