mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-26 18:12:17 +00:00
118762dd6d
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/4452 ## Regexp fixes This fixes #4431 by adjusting the related regular expressions. Also it allows to have multiple spaces between `-` or `*` and the following brackets. Related is the following gitea PR: https://github.com/go-gitea/gitea/pull/3296. I wonder a bit why the author stated > Also fixed the requirement for one character after the blank of - [ ] . I don't see a reason why ``` - [x] some task ``` shall not be a valid checkbox without any character after the `]`. E.g., this would render to - [x] some task The third commit fixes this issue. ### Comments - I wonder a bit why the regexp is written in such complicated way and if ```diff - (^\s*[-*]\s*\[[\sxX]\])|( \s*[-*]\s*\[[\sxX]\]) + (^| )\s*[-*]\s*\[[\sxX]\] ``` would work the same way. Edit: I tried and indeed the second regex works as expected. - ~~Why it is actually matching the `\s` and not just the space (` `)? (but OK, no big issue)~~ Edit: `[\t]` is also allowed. Keep it! - Check boxes in code blocks are counted as well, but I think that this is an edge case which is not a big issue as well. ### Before ![before](https://codeberg.org/attachments/cb4f879d-cdd2-4814-aed2-5de8b5437fb2) ### After ![after](https://codeberg.org/attachments/5d54648f-dd73-4577-9a80-729016219093) ## Javascript fixes Additionally, while testing I figured out, that currently checkboxes with capital `X` like ``` - [X] another task ``` - [X] another task cannot be unchecked. Thus, the second commit fixes that issue as well. ## Checklist The [developer guide](https://forgejo.org/docs/next/developer/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [x] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. Co-authored-by: Robert Wolff <mahlzahn@posteo.de> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4735 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> |
||
---|---|---|
.. | ||
assignees.go | ||
assignees_test.go | ||
comment.go | ||
comment_code.go | ||
comment_list.go | ||
comment_list_test.go | ||
comment_test.go | ||
content_history.go | ||
content_history_test.go | ||
dependency.go | ||
dependency_test.go | ||
issue.go | ||
issue_index.go | ||
issue_index_test.go | ||
issue_label.go | ||
issue_label_test.go | ||
issue_list.go | ||
issue_list_test.go | ||
issue_lock.go | ||
issue_project.go | ||
issue_search.go | ||
issue_stats.go | ||
issue_stats_test.go | ||
issue_test.go | ||
issue_update.go | ||
issue_user.go | ||
issue_user_test.go | ||
issue_watch.go | ||
issue_watch_test.go | ||
issue_xref.go | ||
issue_xref_test.go | ||
label.go | ||
label_test.go | ||
main_test.go | ||
milestone.go | ||
milestone_list.go | ||
milestone_test.go | ||
pull.go | ||
pull_list.go | ||
pull_test.go | ||
reaction.go | ||
reaction_test.go | ||
review.go | ||
review_list.go | ||
review_test.go | ||
stopwatch.go | ||
stopwatch_test.go | ||
tracked_time.go | ||
tracked_time_test.go |