Fix checkboxes in Markdown tables
What does this MR do?
Only tasklist items that are created via our markdown (and thus have the data-sourcepos attribute), can be checked and saved to the source markdown. All others should be disabled, otherwise it's confusing to the user why these checkboxes are not saved. Any hand-coded lists, like in tables, will get disabled.
Related to #26509 (closed)
Screenshots (strongly suggested)
For example,
| TODO |
|------|
| <ul><li>[ ] first row</li></ul> |
| <ul><li>[ ] second row</li></ul> |
| <ul><li>[ ] third row</li></ul> |
---
<ul><li>[ ] handcoded</li></ul>
---
* [x] first
* [x] second
* [ ] third
renders like this
and with the change will render like this
The difference is subtle but notice the checkboxes in the second screenshot are disabled (except for the very last one).
Live example of the problem, at least until this is fixed
TODO |
---|
|
|
|
-
handcoded
-
first -
second -
third
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team