0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2025-01-01 06:34:33 +01:00
gitea/routers/web/repo
silverwind 60e4a98ab0
Preserve BOM in web editor (#28935)
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.
2024-01-27 18:02:51 +00:00
..
actions Fix incorrect action duration time when rerun the job before executed once (#28364) 2024-01-19 14:05:49 +00:00
setting Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
activity.go
attachment.go
blame.go Use information from previous blame parts (#28572) 2023-12-21 22:48:18 +01:00
branch.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
cherry_pick.go
commit.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
compare.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
download.go
editor.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
editor_test.go
find.go
githttp.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
githttp_test.go
helper.go
helper_test.go
issue.go Add ability to see open and closed issues at the same time (#28757) 2024-01-15 15:07:22 +00:00
issue_content_history.go Fix missing check (#28406) 2023-12-10 21:37:10 +02:00
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_pin.go Fix missing check (#28406) 2023-12-10 21:37:10 +02:00
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go Revert adding htmx until we finaly decide to add it (#28879) 2024-01-21 21:42:35 +08:00
main_test.go
middlewares.go
migrate.go
milestone.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
packages.go
patch.go
projects.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
projects_test.go
pull.go Retarget depending pulls when the parent branch is deleted (#28686) 2024-01-17 01:44:56 +01:00
pull_review.go Don't reload timeline page when (un)resolving or replying conversation (#28654) 2024-01-24 03:26:28 +00:00
release.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
release_test.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
render.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
repo.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
search.go
topic.go
treelist.go
view.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
view_test.go
wiki.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
wiki_test.go