forgejo/web_src/js
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
..
components Modernize merge button (#28140) 2024-01-15 00:00:47 +02:00
features Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
markup Change katex limits (#27823) 2023-10-29 01:52:02 +00:00
modules Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08:00
render Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
test Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
utils Polyfill SubmitEvent for PaleMoon (#28441) 2023-12-15 07:26:36 +08: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) 2023-12-15 07:26:36 +08:00
bootstrap.js Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
index.js Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) 2023-10-17 16:10:45 +02: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) 2023-10-11 12:34:21 +00:00
svg.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
utils.js Replace ajax with fetch, improve image diff (#27267) 2023-10-11 12:34:21 +00:00
utils.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00