# 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>
fd5cd9398dQiu shao committed on 8/18/2026, 9:59:35 AM· committed by GitHubparentcf08569