Skip to content

Fix checkboxes in Markdown tables

Brett Walker requested to merge bw-table-task-list into master

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

Screen_Shot_2021-01-28_at_1.10.34_PM

and with the change will render like this

Screen_Shot_2021-01-28_at_1.11.25_PM

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
  • first row
  • second row
  • third row

  • handcoded

  • first
  • second
  • third

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Brett Walker

Merge request reports