# Fix markdown task list marker lookup \(\#60646\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114

Requested commit: fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114

Commit: fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114

Tree: e3640ab1b74f7914b11b7212c4f9eab7ab60142a

Author: Qiu shao

Committer: GitHub

## Message

````
Fix markdown task list marker lookup (#60646)

# Objective


Fix Markdown preview task list checkboxes not rendering for task items
in
  loose or nested lists.

For example, this Markdown should render all three items with
checkboxes:

  ```markdown
  - [ ] test
  - [x] test
    - [x] test
```
  Before this change, the items after blank lines could fall back to ordinary
  list bullets instead of task checkboxes.

## Solution

Update Markdown list item rendering to detect task list markers in both tight
  and loose list event shapes emitted by pulldown-cmark.

  The previous renderer only handled:

  Item -> TaskListMarker

  Loose lists can emit:

  Item -> Paragraph -> TaskListMarker

  This PR adds a small helper to find task markers for both forms, then reuses
  the existing checkbox rendering and toggle behavior.

## Testing

  Tested on macOS with:

  rustup run 1.95.0 cargo test -p markdown
  test_task_marker_lookup_handles_loose_and_nested_lists
  rustup run 1.95.0 cargo test -p markdown test_table_checkbox

  The first test covers loose and nested task list items. The table checkbox
  tests verify that [x] and [ ] inside tables still remain text and are not
  treated as task list checkboxes.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase
before
<img width="927" height="275" alt="image" src="https://github.com/user-attachments/assets/a36f0b9f-8759-4593-99a9-8a256396e89e" />

after
<img width="963" height="322" alt="Snipaste_2026-07-09_12-27-05" src="https://github.com/user-attachments/assets/972fa7a7-274a-4b0a-a13c-c7e1aec27622" />



---

Release Notes:

- Fixed Markdown Preview for loose list item markers

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
````

## Parents

- [cf08569e82b052853927cc7bb00fcbc89c3480e1](https://git.cafe/gitcafe/zed/commit/cf08569e82b052853927cc7bb00fcbc89c3480e1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114?format=markdown)
