gitea/routers/web
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
..
admin Allow to sync tags from admin dashboard (#28045) 2024-01-24 03:02:04 +00:00
auth
devtest
events
explore
feed Set the `isPermaLink` attribute to `false` in the `guid` sub-element (#28860) 2024-01-20 02:38:16 +00:00
healthcheck
misc
org
repo Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
shared
user Revert adding htmx until we finaly decide to add it (#28879) 2024-01-21 21:42:35 +08:00
base.go
githttp.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
goget.go
home.go
metrics.go
nodeinfo.go
swagger_json.go
web.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
webfinger.go