mirror of
1
Fork 0
forgejo/templates/repo
Giteabot b272224918
Preserve BOM in web editor (#28935) (#28959)
Backport #28935 by @silverwind

The `ToUTF8*` functions were stripping BOM, while BOM is actually valid
in UTF8, so the stripping must be optional depending on use case. This
does:

- Add a options struct to all `ToUTF8*` functions, that by default will
strip BOM to preserve existing behaviour
- Remove `ToUTF8` function, it was dead code
- Rename `ToUTF8WithErr` to `ToUTF8`
- Preserve BOM in Monaco Editor
- Remove a unnecessary newline in the textarea value. Browsers did
ignore it, it seems but it's better not to rely on this behaviour.

Fixes: https://github.com/go-gitea/gitea/issues/28743
Related: https://github.com/go-gitea/gitea/issues/6716 which seems to
have once introduced a mechanism that strips and re-adds the BOM, but
from what I can tell, this mechanism was removed at some point after
that PR.

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit b8e6cffd31)
2024-01-31 14:18:26 +01:00
..
actions Fix the runs will not be displayed bug when the main branch have no workflows but other branches have (#28359) (#28365) 2023-12-08 13:41:16 +01:00
branch Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
cite Update JS and PY dependencies (#27501) (#27518) 2023-10-08 19:31:33 +02:00
code
diff Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
editor Preserve BOM in web editor (#28935) (#28959) 2024-01-31 14:18:26 +01:00
find
graph Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
issue Don't reload timeline page when (un)resolving or replying conversation (#28654) (#28917) 2024-01-31 14:18:26 +01:00
migrate Fix duplicate ID when deleting repo (#28520) (#28528) 2023-12-22 12:10:03 +01:00
projects Use full width for project boards (#28225) (#28245) 2023-12-08 13:40:59 +01:00
pulls
release Add download attribute to release attachments (#28739) (#28740) 2024-01-16 14:39:23 +00:00
settings Fix button size in "attached header right" (#28770) (#28774) 2024-01-16 14:39:23 +00:00
tag
wiki
activity.tmpl Render code block in activity tab (#28816) (#28818) 2024-01-31 13:35:54 +01:00
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) (#28803) 2024-01-16 14:41:11 +00:00
commit_status.tmpl Restore warning commit status (#27504) (#27529) 2023-10-09 11:56:02 +08:00
commit_statuses.tmpl
commits.tmpl [GITEA] Detect file rename and show in history 2023-11-13 14:06:30 +01:00
commits_list.tmpl Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
commits_list_small.tmpl Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
commits_table.tmpl
create.tmpl
create_helper.tmpl
empty.tmpl
file_info.tmpl
forks.tmpl
graph.tmpl
header.tmpl Refactor template empty checks (#28351) (#28354) 2023-12-08 13:41:16 +01:00
home.tmpl Add word-break to repo description in home page (#27924) (#27957) 2023-11-08 01:29:33 +00:00
icon.tmpl cleanup repo details icons/labels (#27644) (#27654) 2023-10-19 22:04:24 +02:00
packages.tmpl
release_tag_header.tmpl
search.tmpl Fix 500 error of searching commits (#28576) (#28579) 2023-12-22 12:10:04 +01:00
search_name.tmpl
shabox_badge.tmpl
sub_menu.tmpl Enable followCursor for language stats bar (#27713) (#27739) 2023-10-22 15:35:58 +02:00
unicode_escape_prompt.tmpl
upload.tmpl
user_cards.tmpl
view_file.tmpl Add option to disable ambiguous unicode characters detection (#28454) (#28499) 2023-12-22 12:07:01 +01:00
view_list.tmpl Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
watchers.tmpl