gitea/web_src/js
Giteabot b8e6cffd31
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>
2024-01-27 23:23:31 +01:00
..
components Modernize merge button (#28140) (#28786) 2024-01-15 09:40:52 +08:00
features Preserve BOM in web editor (#28935) (#28959) 2024-01-27 23:23:31 +01:00
markup Change katex limits (#27823) (#27868) 2023-11-01 22:26:45 +01:00
modules Polyfill SubmitEvent for PaleMoon (#28441) (#28478) 2023-12-15 03:04:37 +00:00
render Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
test Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-21 15:40:26 +00:00
utils Polyfill SubmitEvent for PaleMoon (#28441) (#28478) 2023-12-15 03:04:37 +00:00
vendor Vendor jquery.are-you-sure with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Polyfill SubmitEvent for PaleMoon (#28441) (#28478) 2023-12-15 03:04:37 +00:00
bootstrap.js Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-21 15:40:26 +00:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-21 15:40:26 +00:00
index.js Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661) 2023-10-17 14:46:35 +00:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
svg.js Replace ajax with fetch, improve image diff (#27267) (#27583) 2023-10-11 16:12:31 +02:00
svg.test.js Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00
utils.js Replace ajax with fetch, improve image diff (#27267) (#27583) 2023-10-11 16:12:31 +02:00
utils.test.js Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00